From 5f4c465f9727b720f2f6d4b22563db6ae05183b6 Mon Sep 17 00:00:00 2001 From: jjhua Date: Wed, 23 May 2012 07:06:47 +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@12902 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/zvm.pm | 31 +++++++++++++++++------------ 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/zvm.pm b/xCAT-server/lib/xcat/plugins/zvm.pm index d5b047bb4..7de2d2afd 100644 --- a/xCAT-server/lib/xcat/plugins/zvm.pm +++ b/xCAT-server/lib/xcat/plugins/zvm.pm @@ -3215,15 +3215,19 @@ sub nodeSet { $userId =~ tr/a-z/A-Z/; # Get install directory and domain from site table - my $siteTab = xCAT::Table->new('site'); - my $installDirHash = $siteTab->getAttribs( { key => "installdir" }, 'value' ); - my $installDir = $installDirHash->{'value'}; - my $domainHash = $siteTab->getAttribs( { key => "domain" }, 'value' ); - my $domain = $domainHash->{'value'}; - my $masterHash = $siteTab->getAttribs( { key => "master" }, 'value' ); - my $master = $masterHash->{'value'}; - my $xcatdPortHash = $siteTab->getAttribs( { key => "xcatdport" }, 'value' ); - my $xcatdPort = $xcatdPortHash->{'value'}; + #my $siteTab = xCAT::Table->new('site'); + #my $installDirHash = $siteTab->getAttribs( { key => "installdir" }, 'value' ); + my @entries = xCAT::Utils->get_site_attribute("installdir"); + my $installDir = $entries[0]; + #my $domainHash = $siteTab->getAttribs( { key => "domain" }, 'value' ); + @entries = xCAT::Utils->get_site_attribute("domain"); + my $domain = $entries[0]; + #my $masterHash = $siteTab->getAttribs( { key => "master" }, 'value' ); + @entries = xCAT::Utils->get_site_attribute("master"); + my $master = $entries[0]; + #my $xcatdPortHash = $siteTab->getAttribs( { key => "xcatdport" }, 'value' ); + @entries = xCAT::Utils->get_site_attribute("xcatdport"); + my $xcatdPort = $entries[0]; # Get node OS, arch, and profile from 'nodetype' table @propNames = ( 'os', 'arch', 'profile' ); @@ -4304,9 +4308,10 @@ sub updateNode { $userId =~ tr/a-z/A-Z/; # Get install directory - my $siteTab = xCAT::Table->new('site'); - my $installDirHash = $siteTab->getAttribs( { key => "installdir" }, 'value' ); - my $installDir = $installDirHash->{'value'}; + #my $siteTab = xCAT::Table->new('site'); + #my $installDirHash = $siteTab->getAttribs( { key => "installdir" }, 'value' ); + my @entries = xCAT::Utils->get_site_attribute("installdir"); + my $installDir = $entries[0]; # Get host IP and hostname from /etc/hosts my $out = `cat /etc/hosts | grep $node`; @@ -4636,4 +4641,4 @@ sub listTree { } # End of foreach LPAR } # End of foreach CEC return; -} \ No newline at end of file +}