diff --git a/xCAT-server/lib/xcat/plugins/zone.pm b/xCAT-server/lib/xcat/plugins/zone.pm index da98e528b..1e7740e88 100644 --- a/xCAT-server/lib/xcat/plugins/zone.pm +++ b/xCAT-server/lib/xcat/plugins/zone.pm @@ -131,6 +131,16 @@ sub process_request &usage($callback,$command); exit 1; } + # if the ARGS still have data we have invalid input + if (@ARGV) { + my $args=join(',', @ARGV); + my $rsp = {}; + $rsp->{error}->[0] = + "The input to the command: $command contained invalid arguments: $args."; + xCAT::MsgUtils->message("E", $rsp, $callback, 1); + exit 1; + } + if ($options{'help'}) { &usage($callback,$command); @@ -170,6 +180,14 @@ sub process_request } } } + # cannot enter -K and -k + if (($options{'sshkeypath'}) && ($options{'gensshkeys'})) { + my $rsp = {}; + $rsp->{error}->[0] = + "The input of -k and -K is not valid on the command : $command."; + xCAT::MsgUtils->message("E", $rsp, $callback); + exit 1; + } # check for site.sshbetweennodes attribute, put out a warning it will not be used as long # as zones are defined in the zone table. @@ -473,6 +491,18 @@ sub rmzone xCAT::MsgUtils->message("E", $rsp, $callback); return 1; } + # see if they input invalid flags + if (($$options{'sshkeypath'}) || ($$options{'gensshkeys'}) || + ( $$options{'addnoderange'}) || ( $$options{'rmnoderange'}) || + ( $$options{'defaultzone'}) || + ($$options{'sshbetweennodes'})) { + + my $rsp = {}; + $rsp->{error}->[0] = + "The following flags are not valid input for the rmzone command: -k,-K,-a,-r,-f,-s "; + xCAT::MsgUtils->message("E", $rsp, $callback); + return 1; + } # check to see if the input zone already exists # cannot remove it if it is not defined my $zonename=$request->{zonename};