From cfc0a0c2a6e531311a37067b769db74f158789af Mon Sep 17 00:00:00 2001 From: yinle Date: Thu, 12 May 2011 15:19:10 +0000 Subject: [PATCH] Modify the way of getHMCcontrolIP, handle different condition way of fsp/bap with HMC. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9584 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/PPCcli.pm | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/perl-xCAT/xCAT/PPCcli.pm b/perl-xCAT/xCAT/PPCcli.pm index e32d4e94f..15de06f6c 100644 --- a/perl-xCAT/xCAT/PPCcli.pm +++ b/perl-xCAT/xCAT/PPCcli.pm @@ -1315,23 +1315,28 @@ sub getHMCcontrolIP #get node ip from hmc - my $nodes_found = lssyscfg( $exp, "$type", "$node","name,ipaddr,ipaddr_secondary" ); + my $tab = xCAT::Table->new("vpd"); + my $ent; + if ($tab) { + $ent = $tab->getNodeAttribs($node, ['serial', 'mtm']); + } + my $serial = $ent->{'serial'}; + my $mtm = $ent->{'mtm'}; + my $mtms = $mtm . '*' . $serial; + my $nodes_found = lssyscfg( $exp, "$type", "$mtms"); my @ips; my $ip_result; if ( @$nodes_found[0] eq SUCCESS ) { my $Rc = shift(@$nodes_found); #foreach my $mtms ( @$nodes_found ) { - my @newnodes = split(/,/, $nodes_found->[0]); - if ( $node eq $newnodes[0] ) { - if(xCAT::Utils->isIpaddr($newnodes[1])) { - push @ips, $newnodes[1]; - } - if(xCAT::Utils->isIpaddr($newnodes[2])) { - push @ips, $newnodes[2]; - } - $ip_result = join( ",", @ips ); - } - #} + my @newnodes = split(/,/, $nodes_found->[0]); + $Rc = shift(@newnodes); + for my $entry (@newnodes) { + if(xCAT::Utils->isIpaddr($entry)) { + push @ips,$entry; + } + $ip_result = join( ",", @ips ); + } } return $ip_result; }