From 8d365d994f8fb61763ae99dc6543b3604af9f73b Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Fri, 25 Nov 2016 14:30:27 +0100 Subject: [PATCH] fix #1212: allow options for delete in pvesh we did not allow to use parameters in the delete handler in pvesh, but we make use of them (e.g. force on snapshot deleting) as the get/set and delete handler do the same, refactor the if/else paths of them Signed-off-by: Dominik Csapak --- bin/pvesh | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/bin/pvesh b/bin/pvesh index c5debe69..6f7687ef 100755 --- a/bin/pvesh +++ b/bin/pvesh @@ -515,7 +515,7 @@ sub pve_command { list_dir(abs_path($cdir, $path), $args); - } elsif ($cmd eq 'get') { + } elsif ($cmd =~ m/^get|delete|set$/) { my $path; if (scalar(@$args) && $args->[0] !~ m/^\-/) { @@ -533,23 +533,6 @@ sub pve_command { call_method(abs_path($cdir, $path), $cmd, $args, $nooutput); - } elsif ($cmd eq 'delete') { - - my $path = shift @$args; - - die "usage: delete [path]\n" if scalar(@$args); - - call_method(abs_path($cdir, $path), $cmd, $args); - - } elsif ($cmd eq 'set') { - - my $path; - if (scalar(@$args) && $args->[0] !~ m/^\-/) { - $path = shift @$args; - } - - call_method(abs_path($cdir, $path), $cmd, $args); - } else { die "unknown command '$cmd'\n"; }