From d549325b9784033319da1f09203e2a5b21dde4a3 Mon Sep 17 00:00:00 2001 From: wanghuaz Date: Wed, 14 Jan 2009 07:37:14 +0000 Subject: [PATCH] HMC has been updated to add -K netmask option in lpar_netboot.expect. xCAT needs to read the netmask from table and pass this option to HMC if -G,-S,-C has been specified. Defect 2485129: Fail to getmacs from HMC with option -S -C -G git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2597 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/PPCcli.pm | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/perl-xCAT/xCAT/PPCcli.pm b/perl-xCAT/xCAT/PPCcli.pm index fdce1138c..2313815c2 100644 --- a/perl-xCAT/xCAT/PPCcli.pm +++ b/perl-xCAT/xCAT/PPCcli.pm @@ -621,9 +621,9 @@ sub lpar_netboot { $cmd.= " -i"; } else { ################################# - # Determine if LPAR and mgmt node - # are AIX or not. - ################################ + # Determine if LPAR and mgmt node + # are AIX or not. + ################################ my $table = "nodetype"; my @TableRowArray = xCAT::DBobjUtils->getDBtable($table); if (defined(@TableRowArray)) @@ -632,13 +632,12 @@ sub lpar_netboot { { my @nodelist = split(',', $_->{'node'}); my @oslist = split(',', $_->{'os'}); - my $nodename = @$d[6]; my $osname = "AIX"; - if (grep(/^$nodename$/, @nodelist)) + if (grep(/^$name$/, @nodelist)) { if (!grep(/^$osname$/, @oslist) || !xCAT::Utils->isAIX()) { - `xdsh $nodename "shutdown -h now" 2>/dev/null`; + `xdsh $name "shutdown -h now" 2>/dev/null`; last; } } @@ -662,8 +661,16 @@ sub lpar_netboot { # Network specified (-D ping test) ##################################### if ( exists( $opt->{S} )) { + my %nethash = xCAT::DBobjUtils->getNetwkInfo( [$name] ); + ##################################### + # Network attributes undefined + ##################################### + if ( !%nethash ) { + return( [RC_ERROR,"Cannot get network information for $name"] ); + } + my $netmask = $nethash{$name}{mask}; $cmd.= (!defined( $mac )) ? " -D" : ""; - $cmd.= " -s auto -d auto -S $opt->{S} -G $opt->{G} -C $opt->{C}"; + $cmd.= " -s auto -d auto -S $opt->{S} -G $opt->{G} -C $opt->{C} -K $netmask"; } ##################################### # Add lpar name, profile, CEC name