summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJose Asuncion <jeunito@gmail.com>2016-11-21 21:52:54 -0800
committerJose Asuncion <jose.asuncion@gmail.com>2016-11-29 08:43:51 -0800
commitc50418a71f793e2d2daa729962ccf0ed4a9e0628 (patch)
tree68e9249ce124f70b50cb1b63cc305ee7cd145e5a /lib
parent7155ed0447bf558536ed76f109e28fe72848dbe4 (diff)
downloadchef-c50418a71f793e2d2daa729962ccf0ed4a9e0628.tar.gz
add multiple node delete
Signed-off-by: Jose Asuncion <jeunito@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/knife/node_delete.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/chef/knife/node_delete.rb b/lib/chef/knife/node_delete.rb
index 4dd7d764a1..370f2d5ba9 100644
--- a/lib/chef/knife/node_delete.rb
+++ b/lib/chef/knife/node_delete.rb
@@ -30,15 +30,15 @@ class Chef
banner "knife node delete NODE (options)"
def run
- @node_name = @name_args[0]
-
- if @node_name.nil?
+ if @name_args.length == 0
show_usage
- ui.fatal("You must specify a node name")
+ ui.fatal("You must specify at least one node name")
exit 1
end
-
- delete_object(Chef::Node, @node_name)
+
+ @name_args.each do |node_name|
+ delete_object(Chef::Node, node_name)
+ end
end
end