-Fix BUG on empty criteria searches
-Accept '=' as a delimeter for convenience (NodeRange will never support assignment of table values, it makes no sense) git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3981 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
82dc8fa9ca
commit
f688e3f09f
@ -76,6 +76,9 @@ sub nodesbycriteria {
|
||||
} elsif ($criteria =~ /[^=]*==/) {
|
||||
($criteria,$value) = split /==/,$criteria,2;
|
||||
$matchtype='match';
|
||||
} elsif ($criteria =~ /[^=]*=/) {
|
||||
($criteria,$value) = split /=/,$criteria,2;
|
||||
$matchtype='match';
|
||||
} elsif ($criteria =~ /[^=]*!~/) {
|
||||
($criteria,$value) = split /!~/,$criteria,2;
|
||||
$value =~ s/^\///;
|
||||
@ -208,7 +211,11 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels
|
||||
foreach (@allnodeset) {
|
||||
push @nodes,$_->{node};
|
||||
}
|
||||
return @{nodesbycriteria(\@nodes,[$atom])->{$atom}};
|
||||
my $nbyc = nodesbycriteria(\@nodes,[$atom])->{$atom};
|
||||
if (defined $nbyc) {
|
||||
return @$nbyc;
|
||||
}
|
||||
return ();
|
||||
}
|
||||
if ($atom =~ m/^[0-9]+\z/) { # if only numbers, then add the prefix
|
||||
my $nodename=$nprefix.$atom.$nsuffix;
|
||||
|
Loading…
x
Reference in New Issue
Block a user