32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/chef/knife/node_run_list_remove.rb', line 32
def run
node = Chef::Node.load(@name_args[0])
if @name_args.size > 2
entries = @name_args[1..].map do |entry|
entry.split(",").map(&:strip)
end.flatten
else
entries = @name_args[1].split(",").map(&:strip)
end
entries.each do |e|
if node.run_list.find { |rli| e == rli.to_s }
node.run_list.remove(e)
else
ui.warn "#{e} is not in the run list"
unless /^(recipe|role)\[/.match?(e)
ui.warn "(did you forget recipe[] or role[] around it?)"
end
end
end
node.save
config[:run_list] = true
output(format_for_display(node))
end
|