Class: Chef::Provider::Machine

Inherits:
LWRPBase
  • Object
show all
Includes:
ChefMetal::ProviderActionHandler
Defined in:
lib/chef/provider/machine.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ChefMetal::ProviderActionHandler

#debug_name, #open_stream, #perform_action, #performed_action, #should_perform_actions, #updated!

Instance Attribute Details

#node_providerObject (readonly)

Returns the value of attribute node_provider.



64
65
66
# File 'lib/chef/provider/machine.rb', line 64

def node_provider
  @node_provider
end

Class Method Details

.upload_files(action_handler, machine, files) ⇒ Object



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/chef/provider/machine.rb', line 71

def self.upload_files(action_handler, machine, files)
  if files
    files.each_pair do |remote_file, local|
      if local.is_a?(Hash)
        if local[:local_path]
          machine.upload_file(action_handler, local[:local_path], remote_file)
        else
          machine.write_file(action_handler, remote_file, local[:content])
        end
      else
        machine.upload_file(action_handler, local, remote_file)
      end
    end
  end
end

Instance Method Details

#load_current_resourceObject



66
67
68
69
# File 'lib/chef/provider/machine.rb', line 66

def load_current_resource
  @node_provider = Chef::Provider::ChefNode.new(new_resource, run_context)
  @node_provider.load_current_resource
end

#whyrun_supported?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/chef/provider/machine.rb', line 12

def whyrun_supported?
  true
end