From f5bb51388f45629299a3657ec3b03cbec146a4a4 Mon Sep 17 00:00:00 2001 From: yinle Date: Wed, 26 Jan 2011 09:11:39 +0000 Subject: [PATCH] FSP/BPA redundancy: Add supporting database migration to rscan with HMC git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8738 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/PPCscan.pm | 54 +++++++++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/perl-xCAT/xCAT/PPCscan.pm b/perl-xCAT/xCAT/PPCscan.pm index 6756a47d0..50578c19e 100644 --- a/perl-xCAT/xCAT/PPCscan.pm +++ b/perl-xCAT/xCAT/PPCscan.pm @@ -11,6 +11,7 @@ use xCAT::PPCdb; use xCAT::GlobalDef; use xCAT::Usage; use xCAT::NetworkUtils; +use xCAT_plugin::lsslp; ############################################## @@ -292,18 +293,21 @@ sub enumerate { ####################################### # Save two sides of BPA seperately ####################################### - my $bpastr = join( ",","bpa",$fname,$id,$model,$serial,"A",$server,$prof,$bpa,$ipa); - if ( !grep /^\Q$bpastr\E$/, @values) - { - push @values, join( ",", - "bpa",$fname,$id,$model,$serial,"A",$server,$prof,$bpa,$ipa); - } - $bpastr = join( ",","bpa",$fname,$id,$model,$serial,"B",$server,$prof,$bpa,$ipb); - if ( !grep /^\Q$bpastr\E$/, @values) - { - push @values, join( ",", - "bpa",$fname,$id,$model,$serial,"B",$server,$prof,$bpa,$ipb); - } + #my $bpastr = join( ",","bpa",$fname,$id,$model,$serial,"A",$server,$prof,$bpa,$ipa); + #if ( !grep /^\Q$bpastr\E$/, @values) + #{ + # push @values, join( ",", + # "bpa",$fname,$id,$model,$serial,"A",$server,$prof,$bpa,$ipa); + #} + #$bpastr = join( ",","bpa",$fname,$id,$model,$serial,"B",$server,$prof,$bpa,$ipb); + #if ( !grep /^\Q$bpastr\E$/, @values) + #{ + # push @values, join( ",", + # "bpa",$fname,$id,$model,$serial,"B",$server,$prof,$bpa,$ipb); + #} + push @values, join( ",", + "frame",$fname,$id,$model,$serial,"",$server,$prof,$bpa,""); + } ##################################### # Save CEC information @@ -322,7 +326,7 @@ sub enumerate { my $mtmss = $hwconn{$ips}; my ($mtms,$side) = split /,/, $mtmss; push @values, join( ",", - "fsp",$fsp,$cageid,$model,$serial,$side,$server,$prof,$fname,$ips ); + "cec",$fsp,$cageid,$model,$serial,"",$server,$prof,$fname,"" ); ##################################### # Enumerate LPARs @@ -406,7 +410,29 @@ sub format_output { # Strip errors for results ####################################### my @val = grep( !/^#.*: ERROR /, @$values ); - $values = xCAT::PPCdb::update_ppc( $hwtype, \@val ); + #$values = xCAT::PPCdb::update_ppc( $hwtype, \@val ); + foreach my $node (@val) + { + my ($ttype,$tname,$tid,$tmtm,$tsn,$ttmp,$thcp,$tprofile,$tparent) = split /,/, $node; + if ($ttype eq "cec" ) + { + my $hostname = xCAT_plugin::lsslp::gethost_from_url_or_old($tname, "FSP", $tmtm, $tsn, "", "", $tid, "",""); + if ($hostname ne $tname) + { + push @$values, join( ",", + "fsp",$hostname,$tid,$tmtm,$tsn,$ttmp,$thcp,$tprofile,$tparent,""); + } + } + if ($ttype eq "frame" ) + { + my $hostname = xCAT_plugin::lsslp::gethost_from_url_or_old($tname, "BPA", $tmtm, $tsn, "", "", $tid, "",""); + if ($hostname ne $tname) + { + push @$values, join( ",", + "bpa",$hostname,$tid,$tmtm,$tsn,$ttmp,$thcp,$tprofile,$tparent,""); + } + } + } if ( exists( $opt->{x} ) or exists( $opt->{z} )) { unshift @$values, "hmc";