diff options
author | tyler-ball <tyleraball@gmail.com> | 2014-11-25 11:13:54 -0800 |
---|---|---|
committer | tyler-ball <tyleraball@gmail.com> | 2014-11-25 11:13:54 -0800 |
commit | d3c4c4f9b15ea5abd80e5c90160854e3bae6d5c3 (patch) | |
tree | c94dbacbb9d8e69d426941e3a5d539932b7d63be /lib | |
parent | 90ac5191358550e5521b2ecb8df027cde6a5e44a (diff) | |
parent | 47dbeac97bcb57c0eb90a18992faa44272936db5 (diff) | |
download | chef-d3c4c4f9b15ea5abd80e5c90160854e3bae6d5c3.tar.gz |
Merge branch 'patch-3' of github.com:justanshulsharma/chef
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/knife/node_run_list_remove.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/chef/knife/node_run_list_remove.rb b/lib/chef/knife/node_run_list_remove.rb index 8519fd590a..4b8953a264 100644 --- a/lib/chef/knife/node_run_list_remove.rb +++ b/lib/chef/knife/node_run_list_remove.rb @@ -27,11 +27,20 @@ class Chef require 'chef/json_compat' end - banner "knife node run_list remove [NODE] [ENTRIES] (options)" + banner "knife node run_list remove [NODE] [ENTRY[,ENTRY]] (options)" def run node = Chef::Node.load(@name_args[0]) - entries = @name_args[1].split(',') + + if @name_args.size > 2 + # Check for nested lists and create a single plain one + entries = @name_args[1..-1].map do |entry| + entry.split(',').map { |e| e.strip } + end.flatten + else + # Convert to array and remove the extra spaces + entries = @name_args[1].split(',').map { |e| e.strip } + end entries.each { |e| node.run_list.remove(e) } @@ -45,4 +54,3 @@ class Chef end end end - |