From 2be38ac386fd415f883b32fafdfb718aa8d65022 Mon Sep 17 00:00:00 2001 From: jjhua Date: Wed, 23 May 2012 02:57:41 +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@12884 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/iscsi.pm | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/iscsi.pm b/xCAT-server/lib/xcat/plugins/iscsi.pm index d0bcef632..be1d6d3c9 100644 --- a/xCAT-server/lib/xcat/plugins/iscsi.pm +++ b/xCAT-server/lib/xcat/plugins/iscsi.pm @@ -64,18 +64,22 @@ sub process_request { } my $iscsitab = xCAT::Table->new('iscsi'); my @nodes = @{$request->{node}}; - my $sitetab = xCAT::Table->new('site'); - unless ($sitetab) { - $callback->({error=>"Fatal error opening site table",errorcode=>[1]}); - return; - } + #my $sitetab = xCAT::Table->new('site'); + #unless ($sitetab) { + # $callback->({error=>"Fatal error opening site table",errorcode=>[1]}); + # return; + #} my $domain; - (my $ipent) = $sitetab->getAttribs({key=>'domain'},'value'); - if ($ipent and $ipent->{value}) { $domain = $ipent->{value}; } - ($ipent) = $sitetab->getAttribs({key=>'iscsidir'},'value'); + #(my $ipent) = $sitetab->getAttribs({key=>'domain'},'value'); + my @entries = xCAT::Utils->get_site_attribute("domain"); + my $t_entry = $entries[0]; + if ( defined($t_entry) ) { $domain = $t_entry; } + #($ipent) = $sitetab->getAttribs({key=>'iscsidir'},'value'); my $iscsiprefix; - if ($ipent and $ipent->{value}) { - $iscsiprefix = $ipent->{value}; + my @entries = xCAT::Utils->get_site_attribute("iscsidir"); + my $t_entry = $entries[0]; + if ( defined($t_entry) ) { + $iscsiprefix = $t_entry; } foreach my $node (@nodes) { my $fileloc;