fix bug 3472764:incorrect return information for rspconfig

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11432 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
zhaoertao 2012-01-30 06:34:38 +00:00
parent 381834ca6d
commit bee4b04219
2 changed files with 24 additions and 9 deletions

View File

@ -190,11 +190,11 @@ sub parse_args {
$request->{arg} = [$arg];
my $res = xCAT::PPCcfg::parse_args($request, @_);
if (ref($res) eq 'ARRAY') {
my $check_cmd = &check_command($command, \%rsp);
if (!defined($check_cmd)) {
my $check_cmd = &check_command($command, \%rsp);
if (!defined($check_cmd)) {
return $res;
} else {
return ([$_[0], "'$command' is only supported by type $check_cmd."]);
} else {
return ([$_[0], "'$command' is only supported by type $check_cmd."]);
}
} else {
push @ppc_cmds, $command;
@ -233,6 +233,8 @@ sub parse_args {
if ( $result ) {
return( usage($result) );
}
} elsif ($_ =~ /_passwd$/) {
return( usage("No argument specified for '$_'"));
}
}
####################################

View File

@ -158,13 +158,18 @@ sub parse_args {
if ( $result ) {
return( usage($result) );
}
} elsif ($_ =~ /_passwd$/) {
return( usage("No argument specified for '$_'"));
}
}
{
my $result = parse_dev_option( $request, \%cmds);
if ($result) {
return ( usage($result));
}
if ($request->{dev} eq '1' && $request->{other} eq '1') {
return ( usage("Invalid command arrays"));
}
# my $result = parse_dev_option( $request, \%cmds);
# if ($result) {
# return ( usage($result));
# }
}
####################################
# Return method to invoke
@ -310,7 +315,15 @@ sub parse_option {
return( "New password couldn't be empty for user 'HMC'" );
}
}
if ( $command eq 'dev' or $command eq 'celogin1' ) {
if ($value !~ /^(enable|disable)$/i ) {
return( "Invalid argument '$value'" );
}
$request->{dev} = 1;
} else {
$request->{other} = 1;
}
return undef;
}