Class: Chef::Knife::NodePolicySet

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

Instance Method Summary collapse

Instance Method Details

#runObject



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/chef/knife/node_policy_set.rb', line 32

def run
  validate_node!
  validate_options!
  node = Chef::Node.load(@name_args[0])
  set_policy(node)
  if node.save
    ui.info "Successfully set the policy on node #{node.name}"
  else
    ui.info "Error in updating node #{node.name}"
  end
end