From 1a71630307aa8d8fe728fb9141a55e15d52e9aa9 Mon Sep 17 00:00:00 2001 From: jjhua Date: Fri, 18 May 2012 02:52:02 +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@12778 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/PPCmac.pm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/perl-xCAT/xCAT/PPCmac.pm b/perl-xCAT/xCAT/PPCmac.pm index abcb46439..4928836d8 100644 --- a/perl-xCAT/xCAT/PPCmac.pm +++ b/perl-xCAT/xCAT/PPCmac.pm @@ -676,9 +676,14 @@ sub getmacs { return( [[$node,"Node not found, lparid=$lparid",RC_ERROR]] ); } - my $sitetab = xCAT::Table->new('site'); - my $vcon = $sitetab->getAttribs({key => "conserverondemand"}, 'value'); - if ($vcon and $vcon->{"value"} and $vcon->{"value"} eq "yes" ) { + #my $sitetab = xCAT::Table->new('site'); + #my $vcon = $sitetab->getAttribs({key => "conserverondemand"}, 'value'); + #there may be something wrong with the conserverondemand attribute. + # Currently, the code is not used. So not fix this time. Just keep it here. + my @vcons = xCAT::Utils->get_site_attribute("conserverondemand"); + my $vcon = $vcons[0]; + #if ($vcon and $vcon->{"value"} and $vcon->{"value"} eq "yes" ) { + if ( defined($vcon) and $vcon eq "yes" ) { $result = xCAT::PPCcli::lpar_netboot( $exp, $request->{verbose}, @@ -692,7 +697,7 @@ sub getmacs { $result = do_getmacs( $request, $d, $exp, $name, $node ); $Rc = shift(@$result); } - $sitetab->close; + #$sitetab->close; ##################################