From 9dac448093468988105fd4647bc01ff07c2332ac Mon Sep 17 00:00:00 2001 From: jjhua Date: Wed, 23 May 2012 05:12:18 +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@12886 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/mknb.pm | 40 +++++++++++++++++----------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/mknb.pm b/xCAT-server/lib/xcat/plugins/mknb.pm index b623cda5d..70f8577eb 100644 --- a/xCAT-server/lib/xcat/plugins/mknb.pm +++ b/xCAT-server/lib/xcat/plugins/mknb.pm @@ -14,30 +14,38 @@ sub handled_commands { sub process_request { my $request = shift; my $callback = shift; - my $sitetab = xCAT::Table->new('site'); + #my $sitetab = xCAT::Table->new('site'); my $serialport; my $serialspeed; my $serialflow; my $xcatdport = 3001; - if ($sitetab) { - my $portent = $sitetab->getAttribs({key=>'defserialport'},'value'); - if ($portent and defined($portent->{value})) { - $serialport=$portent->{value}; + #if ($sitetab) { + #my $portent = $sitetab->getAttribs({key=>'defserialport'},'value'); + my @entries = xCAT::Utils->get_site_attribute("defserialport"); + my $t_entry = $entries[0]; + if ( defined($t_entry) ) { + $serialport=$t_entry; } - $portent = $sitetab->getAttribs({key=>'defserialspeed'},'value'); - if ($portent and defined($portent->{value})) { - $serialspeed=$portent->{value}; + #$portent = $sitetab->getAttribs({key=>'defserialspeed'},'value'); + @entries = xCAT::Utils->get_site_attribute("defserialspeed"); + $t_entry = $entries[0]; + if ( defined($t_entry) ) { + $serialspeed=$t_entry; } - $portent = $sitetab->getAttribs({key=>'defserialflow'},'value'); - if ($portent and defined($portent->{value})) { - $serialflow=$portent->{value}; + #$portent = $sitetab->getAttribs({key=>'defserialflow'},'value'); + @entries = xCAT::Utils->get_site_attribute("defserialflow"); + $t_entry = $entries[0]; + if ( defined($t_entry) ) { + $serialflow=$t_entry; } - $portent = $sitetab->getAttribs({key=>'xcatdport'},'value'); - if ($portent and defined($portent->{value})) { - $xcatdport=$portent->{value}; + #$portent = $sitetab->getAttribs({key=>'xcatdport'},'value'); + @entries = xCAT::Utils->get_site_attribute("xcatdport"); + $t_entry = $entries[0]; + if ( defined($t_entry) ) { + $xcatdport=$t_entry; } - $sitetab->close; - } + #$sitetab->close; + #} my $tftpdir = xCAT::Utils->getTftpDir(); my $arch = $request->{arg}->[0];