From 4e79358fc2118922cd24aa1f82493147138826fc Mon Sep 17 00:00:00 2001 From: zhanx Date: Thu, 13 Aug 2009 10:57:13 +0000 Subject: [PATCH] fix defect 2835092rspconfig network=eth1,0,0,0,0 fails git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3993 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/PPCfsp.pm | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/perl-xCAT/xCAT/PPCfsp.pm b/perl-xCAT/xCAT/PPCfsp.pm index 093f90b45..a9287fe3a 100644 --- a/perl-xCAT/xCAT/PPCfsp.pm +++ b/perl-xCAT/xCAT/PPCfsp.pm @@ -1761,12 +1761,28 @@ sub set_netcfg if ( $interfaces->{ $real_inc_name}->{'type'}) { my @type_options = @{$interfaces->{ $real_inc_name}->{'type'}->{'menu'}}; - for my $typeopt ( @type_options) + if (ref( $type_options[0]) eq 'HASH') { - if ( $typeopt->{'name'} eq $inc_type) + for my $typeopt ( @type_options) { - $interfaces->{ $real_inc_name}->{'type'}->value($typeopt->{'value'}); - last; + if ( $typeopt->{'name'} eq $inc_type) + { + $interfaces->{ $real_inc_name}->{'type'}->value($typeopt->{'value'}); + last; + } + } + } + else #AIX made the things more complicated, it didn't ship the + #last HTML::Form. So let's take a guess of the type value + #Not sure if it can work for all AIX version + { + if ( $inc_type eq 'Dynamic') + { + $interfaces->{ $real_inc_name}->{'type'}->value(1); + } + else + { + $interfaces->{ $real_inc_name}->{'type'}->value(0); } } #not work on AIX @@ -1789,6 +1805,10 @@ sub set_netcfg return ( [RC_ERROR,"Cannot set hostname to $inc_host"]) if (! $interfaces->{ $real_inc_name}->{'hostname'}); $interfaces->{ $real_inc_name}->{'hostname'}->value( $inc_host); push @set_entries, 'hostname'; + if( ! $interfaces->{ $real_inc_name}->{'hostname'}->value()) + { + $inc_host = $exp->[1]; + } } if ( $inc_gateway) {