mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-30 19:02:27 +00:00 
			
		
		
		
	Updated to skip Flex power blades when "-s CEC" is specified - also corrected model to not filter on 8236 for flex
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@15487 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		| @@ -35,6 +35,7 @@ my %flexchassismap; | ||||
| my %passwordmap; | ||||
| my %doneaddrs; | ||||
| my %btresult; | ||||
| my $option_s; | ||||
|  | ||||
| ####################################### | ||||
| # Constants | ||||
| @@ -325,6 +326,7 @@ sub parse_args { | ||||
|         if ( !exists( $services{$opt{s}} )) { | ||||
|             return(usage( "Invalid service: $opt{s}" )); | ||||
|         } | ||||
| 	$option_s = $opt{s}; | ||||
|         $globalopt{service} = $services{$opt{s}}; | ||||
|     } | ||||
|     ############################################# | ||||
| @@ -1056,7 +1058,10 @@ sub parse_responses { | ||||
|             trace( $request, "Discover node $atthash{hostname}: type is $atthash{type},\ | ||||
| 			mtm is $atthash{mtm},sn is $atthash{serial},  ip is $atthash{ip},\ | ||||
| 			mac is $atthash{mac}, otherinterfaces is $atthash{otherinterfaces}" ); | ||||
|         }elsif (($type eq SERVICE_FSP) && (${$attributes->{'machinetype-model'}}[0] =~ /^7895|8236/ )) { | ||||
|         }elsif (($type eq SERVICE_FSP) && (${$attributes->{'machinetype-model'}}[0] =~ /^7895|1457/ )) { | ||||
|             # Skip this entry if "-s CEC" was specified - we do not list FSP entries for Flex when only CECs were requested | ||||
| 	    next unless ($option_s ne "CEC");   | ||||
|  | ||||
|             #begin to define fsp and bpa | ||||
|             my %tmphash; | ||||
|             $tmphash{type} = ($type eq SERVICE_BPA) ? TYPE_BPA : TYPE_FSP; | ||||
| @@ -1068,6 +1073,7 @@ sub parse_responses { | ||||
|             $tmphash{mac} = $rsp; | ||||
|             $tmphash{parent} =  'Server-'.$tmphash{mtm}.'-SN'.$tmphash{serial}; | ||||
|             $tmphash{hostname} = $tmphash{ip}; | ||||
|             $tmphash{url} =  ${$searchmacs{$rsp}}{payload}; | ||||
|             $tmphash{otherinterfaces} = ${$searchmacs{$rsp}}{peername}; | ||||
|             $tmphash{bpcmtm} = ${$attributes->{'bpc-machinetype-model'}}[0]; | ||||
|             $tmphash{bpcsn} = ${$attributes->{'bpc-serial-number'}}[0]; | ||||
| @@ -1229,7 +1235,7 @@ sub parse_responses { | ||||
|             $newhostname = $::OLD_DATA_CACHE{"frame*".${$outhash{$h}}{mtm}."*".${$outhash{$h}}{serial}}; | ||||
|             if ($newhostname) { | ||||
|                 ${$outhash{$h}}{hostname} = $newhostname ; | ||||
| 				trace ( $request, "$h find hostname $newhostname"); | ||||
| 				trace ( $request, "$h found hostname $newhostname"); | ||||
|                 push  @matchnode, $h; | ||||
|             } | ||||
|         } | ||||
| @@ -1251,7 +1257,7 @@ sub parse_responses { | ||||
|             $parent = $existing_node if ($existing_node); | ||||
|         } | ||||
|         ${$outhash{$h}}{parent} = $parent; | ||||
| 		trace( $request, "$h find parent $parent") if ($parent);  | ||||
| 		trace( $request, "$h found parent $parent") if ($parent);  | ||||
|     } | ||||
|  | ||||
|     trace( $request, "\n\n\nBegin to find cec hostname"); | ||||
| @@ -1259,7 +1265,7 @@ sub parse_responses { | ||||
|         if(${$outhash{$h}}{type} eq TYPE_CEC) { | ||||
|             my $newhostname1 = $::OLD_DATA_CACHE{"cec*".${$outhash{$h}}{mtm}.'*'.${$outhash{$h}}{serial}}; | ||||
|             if ($newhostname1) { | ||||
|                 trace( $request, "$h find hostname $newhostname1 with mtms"); | ||||
|                 trace( $request, "$h found hostname $newhostname1 with mtms"); | ||||
|                 ${$outhash{$h}}{hostname} = $newhostname1; | ||||
|                 push  @matchnode, $h; | ||||
|             } | ||||
| @@ -1268,7 +1274,7 @@ sub parse_responses { | ||||
|             my $newhostname2 = $::OLD_DATA_CACHE{"cec*".$tp.'*'.${$outhash{$h}}{cid}}; | ||||
|             if ($newhostname2) { | ||||
|                 ${$outhash{$h}}{hostname} = $newhostname2; | ||||
|                 trace( $request, "$h find hostname $newhostname2 with parent and id"); | ||||
|                 trace( $request, "$h found hostname $newhostname2 with parent and id"); | ||||
|                 push  @matchnode, $h; | ||||
|             } | ||||
|         } | ||||
| @@ -1277,16 +1283,16 @@ sub parse_responses { | ||||
|     trace( $request, "\n\n\nBegin to find fsp/bpa's hostname and parent"); | ||||
|     foreach my $h ( keys %outhash ) { | ||||
| 	# Added a skip if processing Flex blades | ||||
|         if(((${$outhash{$h}}{type} eq TYPE_FSP) && ${$outhash{$h}}{mtm} !~ /^7895|8236/ ) or ${$outhash{$h}}{type} eq TYPE_BPA) { | ||||
|         if(((${$outhash{$h}}{type} eq TYPE_FSP) && ${$outhash{$h}}{mtm} !~ /^7895|1457/ ) or ${$outhash{$h}}{type} eq TYPE_BPA) { | ||||
|             $newhostname = $::OLD_DATA_CACHE{${$outhash{$h}}{type}."*".${$outhash{$h}}{mtm}.'*'.${$outhash{$h}}{serial}.'*'.${$outhash{$h}}{side}}; | ||||
|             if ($newhostname){ | ||||
|                 ${$outhash{$h}}{hostname} = $newhostname ; | ||||
|                 trace( $request, "$h find hostname $newhostname"); | ||||
|                 trace( $request, "$h found hostname $newhostname"); | ||||
|                 push  @matchnode, $h; | ||||
|             } | ||||
|             my $ptmp = ${$outhash{$h}}{parent}; | ||||
|             ${$outhash{$h}}{parent} = ${$outhash{$ptmp}}{hostname}; | ||||
| 			trace( $request, "$h find parent ${$outhash{$ptmp}}{hostname}"); | ||||
| 			trace( $request, "$h found parent ${$outhash{$ptmp}}{hostname}"); | ||||
|             #check if fsp/bpa's ip is valid | ||||
|             my $vip = check_ip(${$outhash{$h}}{ip}); | ||||
|             unless ( $vip )   { #which means the ip is a valid one | ||||
|   | ||||
		Reference in New Issue
	
	Block a user