diff --git a/xCAT-server/lib/perl/xCAT/IMMUtils.pm b/xCAT-server/lib/perl/xCAT/IMMUtils.pm index d4065a872..5c1b3e04f 100644 --- a/xCAT-server/lib/perl/xCAT/IMMUtils.pm +++ b/xCAT-server/lib/perl/xCAT/IMMUtils.pm @@ -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); } diff --git a/xCAT-server/lib/xcat/plugins/blade.pm b/xCAT-server/lib/xcat/plugins/blade.pm index 3d7e34c9e..c98d77f16 100644 --- a/xCAT-server/lib/xcat/plugins/blade.pm +++ b/xCAT-server/lib/xcat/plugins/blade.pm @@ -5012,7 +5012,7 @@ sub passwd { } else { return ([1, "Update password for $user in 'mpa' table failed"]); } - return ([0, "Success"]); + return ([0, "Succeeded"]); } diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 63a3b4641..8316ae1cb 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -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; + } } }