From b8b4c75c395fb606ab28b51ae0a32e1e018e9572 Mon Sep 17 00:00:00 2001 From: nott Date: Wed, 7 Nov 2012 18:27:13 +0000 Subject: [PATCH] fix NIM if1 parsing and chk_resolv_conf (3162 & 3163) git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14267 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/aixinstall.pm | 32 +++++++++------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/aixinstall.pm b/xCAT-server/lib/xcat/plugins/aixinstall.pm index b34ae06c7..b74e3670d 100644 --- a/xCAT-server/lib/xcat/plugins/aixinstall.pm +++ b/xCAT-server/lib/xcat/plugins/aixinstall.pm @@ -770,15 +770,12 @@ sub nimnodeset # # See if we need to create a resolv_conf resource # - - my $RChash; - $RChash = &chk_resolv_conf($callback, \%objhash, \@nodelist, \%nethash, \%imagehash, \%attrs, \%nodeosi, $subreq); - if ( !$RChash ){ - my $rsp; - push @{$rsp->{data}}, "Could not check NIM resolv_conf resource.\n"; - xCAT::MsgUtils->message("E", $rsp, $callback); + my %resolv_conf_hash = &chk_resolv_conf($callback, \%objhash, \@nodelist, \%nethash, \%imagehash, \%attrs, \%nodeosi, $subreq); + if ( !%resolv_conf_hash ){ + # my $rsp; + # push @{$rsp->{data}}, "Could not check NIM resolv_conf resource.\n"; + # xCAT::MsgUtils->message("E", $rsp, $callback); } - my %resolv_conf_hash = %{$RChash}; # # Get a list of all nim resource types @@ -4632,7 +4629,7 @@ sub mk_resolv_conf_file Returns: - undef - - ptr to hash of resolv_conf resource names + - hash of resolv_conf resource names =cut #----------------------------------------------------------------------------- @@ -5094,7 +5091,7 @@ sub chk_resolv_conf } # end if $create_res } # end foreach node - return \%resolv_conf_hash; + return %resolv_conf_hash; } #---------------------------------------------------------------------------- @@ -10897,14 +10894,12 @@ sub mkdsklsnode # # See if we need to create a resolv_conf resource # - my $RChash; - $RChash = &chk_resolv_conf($callback, \%objhash, \@nodelist, \%nethash, \%imagehash, \%attrs, \%nodeosi, $subreq); - if ( !$RChash ){ - my $rsp; - push @{$rsp->{data}}, "Could not check NIM resolv_conf resource.\n"; - xCAT::MsgUtils->message("E", $rsp, $callback); + my %resolv_conf_hash = &chk_resolv_conf($callback, \%objhash, \@nodelist, \%nethash, \%imagehash, \%attrs, \%nodeosi, $subreq); + if ( !%resolv_conf_hash ){ + # my $rsp; + # push @{$rsp->{data}}, "Could not check NIM resolv_conf resource.\n"; + # xCAT::MsgUtils->message("E", $rsp, $callback); } - my %resolv_conf_hash = %{$RChash}; # # define and initialize the diskless/dataless nodes @@ -12590,14 +12585,13 @@ sub checkNIMnetworks xCAT::MsgUtils->message("E", $rsp, $callback); return 1; } - $ifone =~ s/$target:\s+//; - chomp $ifone; my $junk1; my $junk2; my $adapterhost; my @ifcontent = split('\n',$ifone); foreach my $line (@ifcontent) { + $line =~ s/$target:\s+//; next if ($line =~ /^#/); ($junk1, $junk2, $adapterhost) = split(':', $line); last;