From dab53851c989339593d9bc0a7ddc13dcc8fc55f1 Mon Sep 17 00:00:00 2001 From: jjhua Date: Wed, 23 May 2012 05:17:42 +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@12887 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/nodestat.pm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/nodestat.pm b/xCAT-server/lib/xcat/plugins/nodestat.pm index a349942d9..36325c1bf 100644 --- a/xCAT-server/lib/xcat/plugins/nodestat.pm +++ b/xCAT-server/lib/xcat/plugins/nodestat.pm @@ -175,13 +175,15 @@ sub preprocess_request if ($nodes) { my $usenmapfrommn=0; if (-x '/usr/bin/nmap' or -x '/usr/local/bin/nmap') { - my $sitetab = xCAT::Table->new('site'); - if ($sitetab) { - (my $ref) = $sitetab->getAttribs({key => 'useNmapfromMN'}, 'value'); - if ($ref) { - if ($ref->{value} =~ /1|yes|YES|Y|y/) { $usenmapfrommn=1; } + #my $sitetab = xCAT::Table->new('site'); + #if ($sitetab) { + #(my $ref) = $sitetab->getAttribs({key => 'useNmapfromMN'}, 'value'); + my @entries = xCAT::Utils->get_site_attribute("useNmapfromMN"); + my $t_entry = $entries[0]; + if (defined($t_entry)) { + if ($t_entry =~ /1|yes|YES|Y|y/) { $usenmapfrommn=1; } } - } + #} } #get monsettings