class Chef::Provisioning::ChefProviderActionHandler

Attributes

provider[R]

Public Class Methods

new(provider) click to toggle source
# File lib/chef/provisioning/chef_provider_action_handler.rb, line 25
def initialize(provider)
  @provider = provider
end

Public Instance Methods

host_node() click to toggle source
# File lib/chef/provisioning/chef_provider_action_handler.rb, line 68
def host_node
  "#{provider.run_context.config[:chef_server_url]}/nodes/#{provider.run_context.node['name']}"
end
open_stream(name) { |STDOUT| ... } click to toggle source
# File lib/chef/provisioning/chef_provider_action_handler.rb, line 56
def open_stream(name, &block)
  if provider.run_context.respond_to?(:open_stream)
    provider.run_context.open_stream({ :name => name }, &block)
  else
    if block_given?
      yield STDOUT
    else
      STDOUT
    end
  end
end
perform_action(description, &block) click to toggle source
# File lib/chef/provisioning/chef_provider_action_handler.rb, line 52
def perform_action(description, &block)
  provider.converge_by(description, &block)
end
performed_action(description) click to toggle source
# File lib/chef/provisioning/chef_provider_action_handler.rb, line 46
def performed_action(description)
  provider.converge_by description do
    # We already did the action, but we trust whoever told us that they did it.
  end
end
report_progress(description) click to toggle source
# File lib/chef/provisioning/chef_provider_action_handler.rb, line 39
def report_progress(description)
  # TODO this seems wrong but Chef doesn't have another thing
  provider.converge_by description do
    # We already did the action, but we trust whoever told us that they did it.
  end
end
should_perform_actions() click to toggle source
# File lib/chef/provisioning/chef_provider_action_handler.rb, line 35
def should_perform_actions
  !provider.run_context.config.why_run
end
updated!() click to toggle source
# File lib/chef/provisioning/chef_provider_action_handler.rb, line 31
def updated!
  provider.new_resource.updated_by_last_action(true)
end