From a5e5808512f48eb038ab380dc8d4677726fcfce3 Mon Sep 17 00:00:00 2001 From: yinle Date: Thu, 12 May 2011 10:11:04 +0000 Subject: [PATCH] Fix bug 3300359 : rspconfig HMC sshcfg not display correct state on AIX71B git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9577 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/perl/xCAT/PPC.pm | 62 ++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/xCAT-server/lib/perl/xCAT/PPC.pm b/xCAT-server/lib/perl/xCAT/PPC.pm index 2a28ef1ea..19b4b08aa 100644 --- a/xCAT-server/lib/perl/xCAT/PPC.pm +++ b/xCAT-server/lib/perl/xCAT/PPC.pm @@ -1063,6 +1063,46 @@ sub resolve { $att->{type} = $type; $att->{parent} = exists($att->{parent}) ? $att->{parent} : 0; $att->{bpa} = $att->{parent}; + + my $ntype; + if ( exists( $att->{parent} )) { + $ntype = xCAT::DBobjUtils->getnodetype($att->{parent}); + } + if (( $request->{command} eq "rvitals" ) && + ( $request->{method} =~ /^all|temp$/ && $ntype =~ /^cec$/ )) { + my ($ent) = $tabs->{ppc}->getNodeAttribs( $att->{parent},['parent']); + + ############################# + # Find MTMS in vpd database + ############################# + if (( defined( $ent )) && exists( $ent->{parent} )) { + my @attrs = qw(mtm serial); + my ($vpd) = $tabs->{vpd}->getNodeAttribs($ent->{parent},\@attrs); + + ######################## + # Verify attributes + ######################## + foreach ( @attrs ) { + if ( !defined( $vpd ) || !exists( $vpd->{$_} )) { + return( sprintf( $errmsg{NO_UNDEF}, $_, "vpd", $ent->{parent} )); + } + } + $att->{bpa} = "$vpd->{mtm}*$vpd->{serial}"; + } + } elsif (( $request->{command} eq "rvitals" ) && + ( $request->{method} =~ /^all|temp$/ && $ntype =~ /^bpa$/ )) { + my @attrs = qw(mtm serial); + my ($vpd) = $tabs->{vpd}->getNodeAttribs($att->{parent},\@attrs); + ######################## + # Verify attributes + ######################## + foreach my $attr ( @attrs ) { + if ( !defined( $vpd ) || !exists( $vpd->{$attr} )) { + return( sprintf( $errmsg{NO_UNDEF}, $attr, "vpd", $att->{parent} )); + } + } + $att->{bpa} = "$vpd->{mtm}*$vpd->{serial}"; + } } elsif ( $type =~ /^$::NODETYPE_BPA$/ ) { $att->{pprofile} = 0; @@ -1081,6 +1121,28 @@ sub resolve { $att->{type} = $type; $att->{parent} = exists($att->{parent}) ? $att->{parent} : 0; $att->{bpa} = $att->{parent}; + + if (( $request->{command} eq "rvitals" ) && + ( $request->{method} =~ /^all|temp$/ )) { + + ############################# + # Find MTMS in vpd database + ############################# + if ( exists( $att->{parent} )) { + my @attrs = qw(mtm serial); + my ($vpd) = $tabs->{vpd}->getNodeAttribs($att->{parent},\@attrs); + + ######################## + # Verify attributes + ######################## + foreach ( @attrs ) { + if ( !defined( $vpd ) || !exists( $vpd->{$_} )) { + return( sprintf( $errmsg{NO_UNDEF}, $_, "vpd", $att->{parent} )); + } + } + $att->{bpa} = "$vpd->{mtm}*$vpd->{serial}"; + } + } } elsif ( $type =~ /^$::NODETYPE_FRAME$/ ) { $att->{pprofile} = 0;