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/trunk@15488 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jwsimpson 2013-03-13 19:21:41 +00:00
parent 10ad3b6945
commit d07d624b01

View File

@ -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}};
}
#############################################
@ -1057,6 +1059,9 @@ sub parse_responses {
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|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;
}
}
@ -1281,12 +1287,12 @@ sub parse_responses {
$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