defect 4052

This commit is contained in:
lissav 2014-04-09 09:39:53 -04:00
parent 27d31e7293
commit f6b3d0322f

View File

@ -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};