From d0bb36a3f5867d214955467b0aae532546e1640d Mon Sep 17 00:00:00 2001 From: jjhua Date: Wed, 23 May 2012 06:36:40 +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@12898 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/xen.pm | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/xen.pm b/xCAT-server/lib/xcat/plugins/xen.pm index 99b460968..3f23ff394 100644 --- a/xCAT-server/lib/xcat/plugins/xen.pm +++ b/xCAT-server/lib/xcat/plugins/xen.pm @@ -764,12 +764,14 @@ sub process_request { if ($command eq 'revacuate' or $command eq 'rmigrate') { $vmmaxp=1; #for now throttle concurrent migrations, requires more sophisticated heuristics to ensure sanity } else { - my $sitetab = xCAT::Table->new('site'); - my $tmp; - if ($sitetab) { - ($tmp)=$sitetab->getAttribs({'key'=>'vmmaxp'},'value'); - if (defined($tmp)) { $vmmaxp=$tmp->{value}; } - } + #my $sitetab = xCAT::Table->new('site'); + #my $tmp; + #if ($sitetab) { + #($tmp)=$sitetab->getAttribs({'key'=>'vmmaxp'},'value'); + my @entries = xCAT::Utils->get_site_attribute("vmmaxp"); + my $t_entry = $entries[0]; + if (defined($t_entry)) { $vmmaxp=$t_entry; } + #} } my $children = 0; @@ -814,13 +816,15 @@ sub process_request { my @allerrornodes=(); my $check=0; my $global_check=1; - my $sitetab = xCAT::Table->new('site'); - if ($sitetab) { - (my $ref) = $sitetab->getAttribs({key => 'nodestatus'}, 'value'); - if ($ref) { - if ($ref->{value} =~ /0|n|N/) { $global_check=0; } + #my $sitetab = xCAT::Table->new('site'); + #if ($sitetab) { + #(my $ref) = $sitetab->getAttribs({key => 'nodestatus'}, 'value'); + my @entries = xCAT::Utils->get_site_attribute("nodestatus"); + my $t_entry = $entries[0]; + if ( defined($t_entry) ) { + if ($t_entry =~ /0|n|N/) { $global_check=0; } } - } + #} if ($command eq 'rpower') {