mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-03 21:02:34 +00:00 
			
		
		
		
	accept Bruce's suggestion, not re-copy the hash every time. And it's really more efficient to have an inner foreach that just adds the keys to the hash
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16783 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		@@ -639,16 +639,17 @@ sub getsshbetweennodes
 | 
			
		||||
    if ($values) {
 | 
			
		||||
         my @gs = split(/,/, $values);
 | 
			
		||||
         %groups = map { $_ => 1 } @gs;
 | 
			
		||||
         if( $groups{ALLGROUPS} !=1 || $groups{NOGROUPS} !=1  )  {
 | 
			
		||||
         if( $groups{ALLGROUPS} !=1 && $groups{NOGROUPS} !=1  )  {
 | 
			
		||||
             my @m;
 | 
			
		||||
             foreach my $group (@gs) {
 | 
			
		||||
                   my @ns=xCAT::Utils->list_nodes_in_nodegroups($group);
 | 
			
		||||
                   my %nodes = map { $_ => 1 } @ns;
 | 
			
		||||
                   %groups = (%groups, %nodes); 
 | 
			
		||||
                   foreach my $n (@ns) {
 | 
			
		||||
                       $groups{$n}=1;
 | 
			
		||||
                   }
 | 
			
		||||
             }
 | 
			
		||||
         }
 | 
			
		||||
 | 
			
		||||
    } 
 | 
			
		||||
    }
 | 
			
		||||
    return \%groups;      
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1430,8 +1431,9 @@ sub getNodesSetState
 | 
			
		||||
    my ($ret, $msg)=xCAT::SvrUtils->getNodesetStates($nodes, $nsh);
 | 
			
		||||
    foreach my $state (keys %$nsh) {
 | 
			
		||||
        my $ns = $nsh->{$state};
 | 
			
		||||
        my %result = map {$_ => $state} @$ns;
 | 
			
		||||
        %res = (%result, %res);
 | 
			
		||||
        foreach my $n (@$ns) {
 | 
			
		||||
            $res{$n}=$state;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    return \%res;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user