From 0f240257c95fb43ff24817608f8a6f3b883f2142 Mon Sep 17 00:00:00 2001 From: mellor Date: Tue, 2 Feb 2010 20:03:46 +0000 Subject: [PATCH] changed InstUtils->getOSnodes to default to local OS if nodetype.os not set for node (used to default to Linux) git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5121 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/InstUtils.pm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/perl-xCAT/xCAT/InstUtils.pm b/perl-xCAT/xCAT/InstUtils.pm index b7ebf602f..6b592fcbc 100644 --- a/perl-xCAT/xCAT/InstUtils.pm +++ b/perl-xCAT/xCAT/InstUtils.pm @@ -394,7 +394,7 @@ sub readBNDfile xCAT::InstUtils->get_nim_attr_val($BNDname, 'location', $callback, $nimprime, $sub_req); - # The bundle file may be on nimprime + # The boundle file may be on nimprime my $ccmd = qq~cat $bnd_file_name~; my $output=xCAT::InstUtils->xcmd($callback, $sub_req, "xdsh", $nimprime, $ccmd, 0); if ($::RUNCMD_RC != 0) { @@ -404,6 +404,7 @@ sub readBNDfile } # get the names of the packages + #$output =~ s/$nimprime:\s+//g; foreach my $line (split(/\n/, $output)) { #May include xdsh prefix $nimprime: @@ -412,6 +413,7 @@ sub readBNDfile next if ($line =~ /^\s*$/ || $line =~ /^\s*#/); push(@pkglist, $line); } + close(BNDFILE); return (0, \@pkglist, $bnd_file_name); } @@ -546,8 +548,8 @@ sub taghash Comments: - Based on "os" attr of node definition. This assumes that the "os" - attribute of AIX nodes will always be set! + Based on "os" attr of node definition. If attr is not set, + defaults to OS of current system. Example: my ($rc, $AIXnodes, $Linuxnodes) @@ -569,7 +571,13 @@ sub getOSnodes my $os = $nodetab->getNodesAttribs(\@nodelist, ['node', 'os']); foreach my $n (@nodelist) { - if (($os->{$n}->[0]->{os} ne "AIX") && ($os->{$n}->[0]->{os} ne "aix")) + my $osname; + if (defined($os->{$n}->[0]->{os})) { + $osname = $os->{$n}->[0]->{os}; + } else { + $osname = $^O; + } + if (($osname ne "AIX") && ($osname ne "aix")) { push(@linuxnodes, $n); $rc = 0;