mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-04 05:12:30 +00:00 
			
		
		
		
	fix bug 3429: noderange not expanded correctly for some bracket cases
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16213 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		@@ -190,11 +190,12 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels
 | 
			
		||||
        %allnodehash = map { $_->{node} => 1 } @allnodeset;
 | 
			
		||||
    }
 | 
			
		||||
	my $verify = (scalar(@_) == 1 ? shift : 1);
 | 
			
		||||
  #print "atom=$atom, verify=$verify\n";
 | 
			
		||||
        my @nodes= ();
 | 
			
		||||
    #TODO: these env vars need to get passed by the client to xcatd
 | 
			
		||||
	my $nprefix=(defined ($ENV{'XCAT_NODE_PREFIX'}) ? $ENV{'XCAT_NODE_PREFIX'} : 'node');
 | 
			
		||||
	my $nsuffix=(defined ($ENV{'XCAT_NODE_SUFFIX'}) ? $ENV{'XCAT_NODE_SUFFIX'} : '');
 | 
			
		||||
	if ($allnodehash{$atom}) {		#The atom is a plain old nodename
 | 
			
		||||
	if ($verify && $allnodehash{$atom}) {		#The atom is a plain old nodename
 | 
			
		||||
		return ($atom);
 | 
			
		||||
	}
 | 
			
		||||
    if ($atom =~ /^\(.*\)$/) {     # handle parentheses by recursively calling noderange()
 | 
			
		||||
@@ -208,6 +209,7 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels
 | 
			
		||||
     }
 | 
			
		||||
 | 
			
		||||
    # Try to match groups?
 | 
			
		||||
    if ($verify) {
 | 
			
		||||
        unless ($grptab) {
 | 
			
		||||
           $grptab = xCAT::Table->new('nodegroup');
 | 
			
		||||
        }
 | 
			
		||||
@@ -269,6 +271,7 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels
 | 
			
		||||
        }
 | 
			
		||||
     }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
    if ($atom =~ m/[=~]/) { #TODO: this is the clunky, slow code path to acheive the goal.  It also is the easiest to write, strange coincidence.  Aggregating multiples would be nice
 | 
			
		||||
        my @nodes;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user