fix bug 4555: lsslp -s PBMC does not honor -n flag

This commit is contained in:
ertaozh 2015-02-05 04:35:16 -05:00
parent 276abb3db3
commit 4dd21f1775
5 changed files with 17 additions and 13 deletions

View File

@ -2152,7 +2152,7 @@ sub findme {
my @nodes = ();
my $pbmc_node;
foreach (@$tmp_nodes) {
if ($::XCATPPCHASH{$_}) {
if ($::XCATMPHASH{$_}) {
$pbmc_node = $_;
} else {
push @nodes, $_;

View File

@ -171,7 +171,7 @@ my %globalnodetype = (
ivm => $::NODETYPE_PPC,
cmm => $::NODETYPE_MP,
lpar =>"$::NODETYPE_PPC,$::NODETYPE_OSI",
pbmc => $::NODETYPE_PPC,
pbmc => $::NODETYPE_MP,
);
my %globalmgt = (
fsp => "fsp",
@ -1128,6 +1128,10 @@ sub parse_responses {
$atthash{ip} = ${$searchmacs{$rsp}}{peername};
$atthash{url} = ${$searchmacs{$rsp}}{payload};
$atthash{hostname} = 'Server-'.$atthash{mtm}.'-SN'.$atthash{serial};
if (exists($::OLD_DATA_CACHE{"mp*".$atthash{mtm}."*".$atthash{serial}})) {
$atthash{hostname} = $::OLD_DATA_CACHE{"mp*".$atthash{mtm}."*".$atthash{serial}};
push @matchnode, 'Server-'.$atthash{mtm}.'-SN'.$atthash{serial};
}
$outhash{'Server-'.$atthash{mtm}.'-SN'.$atthash{serial}} = \%atthash;
}elsif (($type eq SERVICE_FSP) && (${$attributes->{'machinetype-model'}}[0] =~ /^7895|1457|7954/ )) {
@ -1496,7 +1500,7 @@ sub xCATdB {
$machash{$hostname} = {mac=>$mac} if ($type =~ /^fsp|bpa$/);
} elsif ( $type =~ /^pbmc$/) {
$nodelisthash{$hostname} = {groups=>$groups, hidden=>$hidden};
$ppchash{$hostname} = {nodetype=>$globalhwtype{$type}};
$mphash{$hostname} = {nodetype=>$globalhwtype{$type}};
$vpdhash{$hostname} = {mtm=>$model, serial=>$serial};
$nodehmhash{$hostname} = {mgt=>$globalmgt{$type}};
$nodetypehash{$hostname} = {nodetype=>$globalnodetype{$type}};

View File

@ -135,7 +135,7 @@ sub findme {
my $mtms = $request->{'mtm'}->[0]."*".$request->{'serial'}->[0];
my $tmp_nodes = $::XCATVPDHASH{$mtms};
foreach (@$tmp_nodes) {
if ($::XCATPPCHASH{$_}) {
if ($::XCATMPHASH{$_}) {
$pbmc_node = $_;
}
}

View File

@ -162,7 +162,7 @@ sub process_request {
my $mtms = $req->{'mtm'}->[0]."*".$req->{'serial'}->[0];
my $tmp_nodes = $::XCATVPDHASH{$mtms};
foreach (@$tmp_nodes) {
if ($::XCATPPCHASH{$_}) {
if ($::XCATMPHASH{$_}) {
$pbmc_node = $_;
}
}

View File

@ -568,12 +568,12 @@ sub do_discovery_process {
$dispatch_requests=0;
populate_site_hash();
populate_vpd_hash();
populate_ppc_hash();
populate_mp_hash();
while (not $quit) {
if ((time()-$vintage)> 15) {
populate_site_hash();
populate_vpd_hash();
populate_ppc_hash();
populate_mp_hash();
$vintage = time();
} #site table reread every 15 second
my $msg = fd_retrieve($broker);
@ -2145,14 +2145,14 @@ sub populate_vpd_hash {
push @{$::XCATVPDHASH{$mtms}}, $_->{node};
}
}
sub populate_ppc_hash {
%::XCATPPCHASH=();
my $ppctab = xCAT::Table->new('ppc',-create=>0);
unless ($ppctab) {return;}
my @entries = $ppctab->getAllAttribs(qw/node nodetype/);
sub populate_mp_hash {
%::XCATMPHASH=();
my $mptab = xCAT::Table->new('mp',-create=>0);
unless ($mptab) {return;}
my @entries = $mptab->getAllAttribs(qw/node nodetype/);
foreach (@entries) {
if ($_->{nodetype} and $_->{nodetype} eq 'pbmc') {
$::XCATPPCHASH{$_->{node}}=$_->{nodetype};
$::XCATMPHASH{$_->{node}}=$_->{nodetype};
}
}
}