Class: Chef::Provisioning::ActionHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/provisioning/action_handler.rb

Direct Known Subclasses

ChefProviderActionHandler

Instance Method Summary collapse

Instance Method Details

#host_nodeObject

A URL identifying the host node. nil if no such node.



64
65
# File 'lib/chef/provisioning/action_handler.rb', line 64

def host_node
end

#open_stream(name) ⇒ Object

Open a stream which can be printed to and closed



55
56
57
58
59
60
61
# File 'lib/chef/provisioning/action_handler.rb', line 55

def open_stream(name)
  if block_given?
    yield STDOUT
  else
    STDOUT
  end
end

#perform_action(description) ⇒ Object

This should perform the actual action (e.g., converge) if there is an action that needs to be done.



44
45
46
47
48
49
50
51
52
# File 'lib/chef/provisioning/action_handler.rb', line 44

def perform_action(description)
  if should_perform_actions
    result = yield
  else
    result = nil
  end
  performed_action(description)
  result
end

#performed_action(description) ⇒ Object



38
39
40
# File 'lib/chef/provisioning/action_handler.rb', line 38

def performed_action(description)
  Array(description).each { |d| puts d }
end

#report_progress(description) ⇒ Object



34
35
36
# File 'lib/chef/provisioning/action_handler.rb', line 34

def report_progress(description)
  Array(description).each { |d| puts d }
end

#should_perform_actionsObject



30
31
32
# File 'lib/chef/provisioning/action_handler.rb', line 30

def should_perform_actions
  true
end

#updated!Object

This should be replaced with whatever records the update; by default it essentially does nothing here.



26
27
28
# File 'lib/chef/provisioning/action_handler.rb', line 26

def updated!
  @updated = true
end