From e596348dc7f677066f0cacb464bf12af45562a36 Mon Sep 17 00:00:00 2001 From: jjhua Date: Tue, 22 May 2012 02:54:17 +0000 Subject: [PATCH] For the places that open site table to read attributes, change to call xCAT::Utils->get_site_attribute instead git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12854 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/bmcconfig.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcconfig.pm b/xCAT-server/lib/xcat/plugins/bmcconfig.pm index 9dd82eefd..cca06fe67 100644 --- a/xCAT-server/lib/xcat/plugins/bmcconfig.pm +++ b/xCAT-server/lib/xcat/plugins/bmcconfig.pm @@ -92,7 +92,7 @@ sub process_request { $callback->({error=>["Unable to prove root on your IP approves of this request"],errorcode=>[1]}); return; } - my $sitetable = xCAT::Table->new('site'); + #my $sitetable = xCAT::Table->new('site'); my $ipmitable = xCAT::Table->new('ipmi'); my $passtable = xCAT::Table->new('passwd'); my $tmphash; @@ -109,8 +109,10 @@ sub process_request { if ($tmphash->{password}) { #It came for free with the last query $password=$tmphash->{password}; } - $tmphash=($sitetable->getAttribs({key=>'genpasswords'},'value'))[0]; - if ($tmphash->{value} eq "1" or $tmphash->{value} =~ /y(es)?/i) { + #$tmphash=($sitetable->getAttribs({key=>'genpasswords'},'value'))[0]; + my @entries = xCAT::Utils->get_site_attribute("blademaxp"); + my $site_entry = $entries[0]; + if ($site_entry eq "1" or $site_entry =~ /y(es)?/i) { $password = genpassword(10)."1cA!"; $gennedpassword=1; $tmphash=$ipmitable->getNodeAttribs($node,['bmc','username','bmcport','taggedvlan']);