From f42e8325999b566bb26c0efb59ec03fc8f1b9bef Mon Sep 17 00:00:00 2001 From: linggao Date: Thu, 29 Mar 2012 20:30:12 +0000 Subject: [PATCH] More efficient when calling getstate for pxe,xnba and yaboot during node deployment or updatenode git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@12062 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/perl/xCAT/SvrUtils.pm | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/SvrUtils.pm b/xCAT-server/lib/perl/xCAT/SvrUtils.pm index 58fad5fe3..568293016 100644 --- a/xCAT-server/lib/perl/xCAT/SvrUtils.pm +++ b/xCAT-server/lib/perl/xCAT/SvrUtils.pm @@ -150,10 +150,22 @@ sub get_nodeset_state } 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 @@ sub get_nodeset_state 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]; }