enhancement of "rspconfig noderange USERID=<password>"

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@16407 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
zhaoertao 2013-05-23 08:13:22 +00:00
parent cbdd1d4a9a
commit e0c25f0672
3 changed files with 20 additions and 6 deletions

View File

@ -77,6 +77,14 @@ sub setupIMM {
Prompt=>'/> $/');};
my $errmsg = $@;
if ($errmsg) {
if ($errmsg =~ /Login Failed/) {
$errmsg = "Login failed";
} elsif ($errmsg =~ /Incorrect Password/) {
$errmsg = "Incorrect Password";
} else {
$errmsg = "Failed";
}
sendmsg(":$errmsg", $callback, $node);
exit(0);
}
if ($ssh and $ssh->atprompt) { #we are in and good to issue commands
@ -97,6 +105,7 @@ sub setupIMM {
$ssh->close();
$ipmitab->setNodeAttribs($node,{bmcid=>$nodedata->{macaddress}});
}
sendmsg(":Succeeded", $callback,$node);
exit(0);
}

View File

@ -5012,7 +5012,7 @@ sub passwd {
} else {
return ([1, "Update password for $user in 'mpa' table failed"]);
}
return ([0, "Success"]);
return ([0, "Succeeded"]);
}

View File

@ -6055,11 +6055,16 @@ sub process_request {
$index++;
}
if ($updatepasswd) {
splice(@{$request->{arg}}, $index, 1);
@exargs=($request->{arg});
foreach (@donargs) {
xCAT::IMMUtils::setupIMM($_->[0],curraddr=>$_->[1],skipbmcidcheck=>1,skipnetconfig=>1,cliusername=>$_->[2],clipassword=>$_->[3],callback=>$callback);
}
splice(@{$request->{arg}}, $index, 1);
@exargs=@{$request->{arg}};
foreach (@donargs) {
my $cliuser = $authdata->{$_->[0]}->{cliusername};
my $clipass = $authdata->{$_->[0]}->{clipassword};
xCAT::IMMUtils::setupIMM($_->[0],curraddr=>$_->[1],skipbmcidcheck=>1,skipnetconfig=>1,cliusername=>$cliuser,clipassword=>$clipass,callback=>$callback);
}
if ($#exargs == -1) {
return;
}
}
}