pre-create mypostscript enhancement: get_nodeset_state uses the values of the noderes.net boot noderes.tftpdir which were got ahead of time

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14188 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jjhua 2012-11-01 02:10:01 +00:00
parent d15a2add7a
commit 6ed9c4c9b1

View File

@ -160,24 +160,37 @@ sub get_nodeset_state
my $state = "undefined";
my $tftpdir;
my $boottype;
if( defined(%::GLOBAL_TAB_HASH) && defined($::GLOBAL_TAB_HASH{noderes}) && defined($::GLOBAL_TAB_HASH{noderes}{$node}) ) {
$tftpdir = $::GLOBAL_TAB_HASH{noderes}{$node}{tftpdir};
$boottype = $::GLOBAL_TAB_HASH{noderes}{$node}{netboot};
} else {
#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 tftpdir)],%gnopts);
#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})
{
$boottype = $ent->{netboot};
}
#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 tftpdir)],%gnopts);
#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})
if ( defined($boottype) )
{
my $boottype = $ent->{netboot};
#my $boottype = $ent->{netboot};
#get nodeset state from corresponding files
if ($boottype eq "pxe")
@ -212,7 +225,7 @@ sub get_nodeset_state
require xCAT_plugin::aixinstall;
$state = xCAT_plugin::aixinstall::getNodesetState($node);
}
#get the nodeset state from the chain table as a backup.
if ($state eq "undefined")
{