From d6feb34e0c38b50f0a16e3feb411ca20e7bebd0d Mon Sep 17 00:00:00 2001 From: WangXiaoPeng Date: Tue, 28 Apr 2015 08:31:18 -0400 Subject: [PATCH] defect 4657: PCM has requirement that the user/password of fsp are different with the ones of ipmi for ppcle node. That means our renergy command should read 'passwd:fsp' first, if it does not exist, then use the default passwd 'admin/admin' instead of use the password from ipmi. --- xCAT-server/lib/xcat/plugins/energy.pm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/energy.pm b/xCAT-server/lib/xcat/plugins/energy.pm index c39b43ab9..3f9a05d69 100644 --- a/xCAT-server/lib/xcat/plugins/energy.pm +++ b/xCAT-server/lib/xcat/plugins/energy.pm @@ -336,6 +336,13 @@ sub process_request { $nodehm_hash = $nodehm_tab->getNodesAttribs($request->{node}, ['mgt']); } + # get the 'fsp' key from the passwd table + my $passwd_tab = xCAT::Table->new('passwd', -create => 0); + my $passwd_hash; + if ($passwd_tab) { + $passwd_hash = $passwd_tab->getAttribs({key=>'fsp'},qw(username password)); + } + my $ppcdirect_tab = xCAT::Table->new('ppcdirect', -create=>0); my $children; # The number of child process @@ -399,9 +406,11 @@ sub process_request { if (defined ($ipmi_hash->{$node}->[0]->{bmc})){ # This is a ipmi managed node. (should be a ppcle) $hcp_ip = $ipmi_hash->{$node}->[0]->{bmc}; - if (defined ($ipmi_hash->{$node}->[0]->{username})){ - $user = $ipmi_hash->{$node}->[0]->{username}; - $password = $ipmi_hash->{$node}->[0]->{password}; + + # Get the passwd from passwd table for 'fsp' first, if not the default will be used + if (defined($passwd_hash->{username}) && defined($passwd_hash->{password})) { + $user = $passwd_hash->{username}; + $password = $passwd_hash->{password}; } } else { xCAT::MsgUtils->message("E", {data => ["$node: Missed attribute [bmc]."]}, $callback);