fix for bug 2821739: check the whether the grptab is null before using it.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3799 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
ligc 2009-07-15 18:20:16 +00:00
parent 680c49235a
commit 9ddf4569e3

View File

@ -90,12 +90,14 @@ sub expandatom {
# check to see if atom is a defined group name that didn't have any current members
if ( scalar @nodes == 0 ) {
#for my $row ( $nodegroup->getAllAttribs('groupname') ) {
for my $row ( $grptab->getAllAttribs('groupname') ) {
if ( $row->{groupname} eq $atom ) {
return ();
}
}
if($grptab) {
my @grouplist = $grptab->getAllAttribs('groupname');
for my $row ( @grouplist ) {
if ( $row->{groupname} eq $atom ) {
return ();
}
}
}
}
if ($atom =~ m/^[0-9]+\z/) { # if only numbers, then add the prefix