mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-30 19:02:27 +00:00 
			
		
		
		
	Use option '-D' of getmacs to determinate the operation mode of a pblade, -D for DFM, else for CMM
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11485 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		| @@ -3528,14 +3528,22 @@ sub preprocess_request { | ||||
|  | ||||
|   #parse the arguments for commands | ||||
|   if ($command eq "getmacs") { | ||||
|     foreach my $arg (@exargs) { | ||||
|       if (defined($arg) && $arg !~ /^-V|--verbose|-d|--arp$/) { | ||||
|         $usage_string="Error arguments\n"; | ||||
|         $usage_string .=xCAT::Usage->getUsage($command); | ||||
|         $callback->({data=>$usage_string}); | ||||
|         $request = {}; | ||||
|         return; | ||||
|     my (@mpnodes, @fspnodes); | ||||
|     filter_nodes($request, \@mpnodes, \@fspnodes); | ||||
|     if (@mpnodes) { | ||||
|       $noderange = \@mpnodes; | ||||
|       foreach my $arg (@exargs) { | ||||
|         if (defined($arg) && $arg !~ /^-V|--verbose|-d|--arp$/) { | ||||
|           $usage_string= ":Error arguments\n"; | ||||
|           $usage_string .=xCAT::Usage->getUsage($command); | ||||
|           $callback->({data=>$usage_string}); | ||||
|           $request = {}; | ||||
|           return; | ||||
|         } | ||||
|       } | ||||
|     } else { | ||||
|       $request = {}; | ||||
|       return; | ||||
|     } | ||||
|   } elsif ($command eq "renergy") { | ||||
|     if (! @exargs) { | ||||
| @@ -3706,12 +3714,28 @@ sub filter_nodes{ | ||||
|  | ||||
|     push @{$mpnodes}, @mp; | ||||
|     push @{$fspnodes}, @commonfsp; | ||||
|     ## TRACE_LINE print "Nodes filter: mpnodes [@{$mpnodes}], fspnodes [@{$fspnodes}]\n"; | ||||
|     if (@args && ($cmd eq "rspconfig") && (grep /^(network|network=.*)$/, @args)) { | ||||
|       push @{$mpnodes}, @ngpfsp; | ||||
|     } elsif($cmd eq "getmacs") { | ||||
|       if (@args && (grep /^-D$/,@args)) { | ||||
|         @mp = (); | ||||
|         foreach (@{$mpnodes}) { | ||||
|           if (defined($ppctabhash->{$_}->[0]->{'parent'})) { | ||||
|             push @{$fspnodes}, $_; | ||||
|           } else { | ||||
|             push @mp, $_; | ||||
|           } | ||||
|         } | ||||
|         push @{$fspnodes}, @ngpfsp; | ||||
|         @{$mpnodes} = ();; | ||||
|         push @{$mpnodes}, @mp; | ||||
|       } else {  | ||||
|         push @{$mpnodes}, @ngpfsp; | ||||
|       } | ||||
|     } else { | ||||
|       push @{$fspnodes}, @ngpfsp; | ||||
|     } | ||||
|     ## TRACE_LINE print "Nodes filter: mpnodes [@{$mpnodes}], fspnodes [@{$fspnodes}]\n"; | ||||
|  | ||||
|     return 0; | ||||
| } | ||||
|   | ||||
| @@ -84,7 +84,16 @@ sub preprocess_request { | ||||
|             return []; | ||||
|         } | ||||
|     } | ||||
|      | ||||
|  | ||||
|     if ($arg1->{command}->[0] eq "getmacs") { | ||||
|         my (@mpnodes, @fspnodes); | ||||
|         filter_nodes($arg1, \@mpnodes, \@fspnodes); | ||||
|         if (@fspnodes) { | ||||
|             $arg1->{noderange} = \@fspnodes; | ||||
|         } else { | ||||
|             return []; | ||||
|         } | ||||
|     } | ||||
|     xCAT::PPC::preprocess_request(__PACKAGE__,@_); | ||||
| } | ||||
|  | ||||
| @@ -160,10 +169,25 @@ sub filter_nodes{ | ||||
|     push @{$fspnodes}, @commonfsp; | ||||
|     if (@args && ($cmd eq "rspconfig") && (grep /^(network|network=.*)$/, @args)) { | ||||
|       push @{$mpnodes}, @ngpfsp; | ||||
|     } elsif($cmd eq "getmacs") { | ||||
|       if (@args && (grep /^-D$/,@args)) { | ||||
|         @mp = (); | ||||
|         foreach (@{$mpnodes}) { | ||||
|           if (defined($ppctabhash->{$_}->[0]->{'parent'})) { | ||||
|             push @{$fspnodes}, $_; | ||||
|           } else { | ||||
|             push @mp, $_; | ||||
|           } | ||||
|         } | ||||
|         push @{$fspnodes}, @ngpfsp; | ||||
|         @{$mpnodes} = (); | ||||
|         push @{$mpnodes}, @mp; | ||||
|       } else {  | ||||
|         push @{$mpnodes}, @ngpfsp; | ||||
|       } | ||||
|     } else { | ||||
|       push @{$fspnodes}, @ngpfsp; | ||||
|     } | ||||
|  | ||||
|     return 0; | ||||
| } | ||||
| ########################################################################## | ||||
|   | ||||
		Reference in New Issue
	
	Block a user