fix bugs about rspconfig cmm USERID=<new_passwd>

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11799 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
zhaoertao 2012-03-09 01:57:25 +00:00
parent ebb3f27e55
commit 2a9414124f

View File

@ -4224,19 +4224,19 @@ sub passwd {
my $user = shift;
my $pass = shift;
my $mm = shift;
my $cmd = "users -n $user -p $pass -T system:$mm";
if (!$pass) {
return ([1, "No param specified for '$user'"]);
}
my @data = $t->cmd($cmd);
if (!grep(/OK/i, @data)) {
return ([1, @data]);
}
my $mpatab = xCAT::Table->new('mpa');
if ($mpatab) {
my ($ent)=$mpatab->getNodeSpecAttribs($mpa, {username=>$user},qw(password));
my $oldpass = 'PASSW0RD';
if (defined($ent->{password})) {$oldpass = $ent->{password}};
my $cmd = "users -n $user -op $oldpass -p $pass -T system:$mm";
my @data = $t->cmd($cmd);
if (!grep(/OK/i, @data)) {
return ([1, @data]);
}
$mpatab->setAttribs({mpa=>$mpa,username=>$user},{password=>$pass});
if ($user eq "HMC") {
my $fsp_api = ($::XCATROOT) ? "$::XCATROOT/sbin/fsp-api" : "/opt/xcat/sbin/fsp-api";