From 04bd59443c95432b9a1798ddaccad988acd8ad4e Mon Sep 17 00:00:00 2001 From: immarvin Date: Wed, 15 Jun 2016 05:13:00 -0400 Subject: [PATCH] fix nicips.enP5p7s0f1 can not removed from node definition. #1276 --- perl-xCAT/xCAT/DBobjUtils.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/perl-xCAT/xCAT/DBobjUtils.pm b/perl-xCAT/xCAT/DBobjUtils.pm index 1cbaeac1d..f71625898 100755 --- a/perl-xCAT/xCAT/DBobjUtils.pm +++ b/perl-xCAT/xCAT/DBobjUtils.pm @@ -2541,10 +2541,8 @@ sub collapsenicsattr() if ($1 && $2) { # chdef nicips.eth2= to remove the definition for eth2 # in this case, the $nodeattrhash->{'nicips.eth0'} is blank - if ($nodeattrhash->{$nodeattr}) { - # $nicattrs{nicips}{eth0} = "1.1.1.1|1.2.1.1" - $nicattrs{$1}{$2} = $nodeattrhash->{$nodeattr}; - } + # $nicattrs{nicips}{eth0} = "1.1.1.1|1.2.1.1" + $nicattrs{$1}{$2} = $nodeattrhash->{$nodeattr}; # remove nicips.eth0 from the %::FILEATTRS delete $nodeattrhash->{$nodeattr}; @@ -2557,7 +2555,9 @@ sub collapsenicsattr() my @tmparray = (); foreach my $nicname (keys %{$nicattrs{$nicattr}}) { # eth0!1.1.1.1|1.2.1.1 - push @tmparray, "$nicname!$nicattrs{$nicattr}{$nicname}"; + if($nicattrs{$nicattr}{$nicname}){ + push @tmparray, "$nicname!$nicattrs{$nicattr}{$nicname}"; + } } # eth0!1.1.1.1|1.2.1.1,eth1!2.1.1.1|2.2.1.1 $nodeattrhash->{$nicattr} = join(',', @tmparray);