Class: Chef::Knife::NodeFromFile

Inherits:
Knife
  • Object
show all
Defined in:
lib/chef/knife/node_from_file.rb

Instance Method Summary collapse

Instance Method Details

#loaderObject



33
34
35
# File 'lib/chef/knife/node_from_file.rb', line 33

def loader
  @loader ||= Knife::Core::ObjectLoader.new(Chef::Node, ui)
end

#runObject



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/chef/knife/node_from_file.rb', line 37

def run
  @name_args.each do |arg|
    updated = loader.load_from("nodes", arg)

    updated.save

    output(format_for_display(updated)) if config[:print_after]

    ui.info("Updated Node #{updated.name}")
  end
end