From: <li...@us...> - 2012-03-29 20:30:21
|
Revision: 12062 http://xcat.svn.sourceforge.net/xcat/?rev=12062&view=rev Author: linggao Date: 2012-03-29 20:30:12 +0000 (Thu, 29 Mar 2012) Log Message: ----------- More efficient when calling getstate for pxe,xnba and yaboot during node deployment or updatenode Modified Paths: -------------- xcat-core/branches/2.7/xCAT-server/lib/perl/xCAT/SvrUtils.pm Modified: xcat-core/branches/2.7/xCAT-server/lib/perl/xCAT/SvrUtils.pm =================================================================== --- xcat-core/branches/2.7/xCAT-server/lib/perl/xCAT/SvrUtils.pm 2012-03-29 20:26:25 UTC (rev 12061) +++ xcat-core/branches/2.7/xCAT-server/lib/perl/xCAT/SvrUtils.pm 2012-03-29 20:30:12 UTC (rev 12062) @@ -150,10 +150,22 @@ } my $state = "undefined"; + my $tftpdir; #get boot type (pxe, yaboot or aixinstall) for the node my $noderestab = xCAT::Table->new('noderes', -create => 0); - my $ent = $noderestab->getNodeAttribs($node, [qw(netboot)]); + my $ent = $noderestab->getNodeAttribs($node, [qw(netboot tftpdir)]); + + #get tftpdir from the noderes table, if not defined get it from site talbe + if ($ent && $ent->{tftpdir}) { + $tftpdir=$ent->{tftpdir}; + } + if (!$tftpdir) { + if ($::XCATSITEVALS{tftpdir}) { + $tftpdir=$::XCATSITEVALS{tftpdir}; + } + } + if ($ent && $ent->{netboot}) { my $boottype = $ent->{netboot}; @@ -162,21 +174,21 @@ if ($boottype eq "pxe") { require xCAT_plugin::pxe; - my $tmp = xCAT_plugin::pxe::getstate($node); + my $tmp = xCAT_plugin::pxe::getstate($node, $tftpdir); my @a = split(' ', $tmp); $state = $a[0]; } elsif ($boottype eq "xnba") { require xCAT_plugin::xnba; - my $tmp = xCAT_plugin::xnba::getstate($node); + my $tmp = xCAT_plugin::xnba::getstate($node, $tftpdir); my @a = split(' ', $tmp); $state = $a[0]; } elsif ($boottype eq "yaboot") { require xCAT_plugin::yaboot; - my $tmp = xCAT_plugin::yaboot::getstate($node); + my $tmp = xCAT_plugin::yaboot::getstate($node, $tftpdir); my @a = split(' ', $tmp); $state = $a[0]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |