fix bug 3515394: rspconfig passwd for cmm error

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@12171 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
zhaoertao 2012-04-10 05:27:21 +00:00
parent dd953a1d17
commit d401f59d7f

View File

@ -4282,6 +4282,12 @@ sub passwd {
my $snmp_cmd = "users -n $user -ap sha -pp des -ppw $pass -T system:$mm";
@data = $t->cmd($snmp_cmd);
if (!grep(/OK/i, @data)) {
$cmd = "users -n $user -op $pass -p $oldpass -T system:$mm";
my @back_pwd = $t->cmd($cmd);
if (!grep(/OK/i, @back_pwd)) {
#if we update password backward failed, we should update the mpa table for further use#
$mpatab->setAttribs({mpa=>$mpa,username=>$user},{password=>$pass});
}
return ([1, @data]);
}
$mpatab->setAttribs({mpa=>$mpa,username=>$user},{password=>$pass});