From f678701ed53f05aa751afad623f694e1aab5857b Mon Sep 17 00:00:00 2001 From: daniceexi Date: Wed, 20 Jan 2010 13:45:18 +0000 Subject: [PATCH] defect 2935401: fix the defect that write the nameserver attribute with wrong format git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4995 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/networks.pm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/networks.pm b/xCAT-server/lib/xcat/plugins/networks.pm index 6b87eedf8..0a877910d 100644 --- a/xCAT-server/lib/xcat/plugins/networks.pm +++ b/xCAT-server/lib/xcat/plugins/networks.pm @@ -277,11 +277,14 @@ sub donets close($rconf); foreach (grep /nameserver/, @rcont) { - my $line = $_; - my @pair; - $line =~ s/#.*//; - @pair = split(/\s+/, $line); - push @nameservers, $pair[1]; + my $line = $_; + my @pair; + $line =~ s/#.*//; + $line =~ s/^\s*//; + @pair = split(/\s+/, $line); + if ($pair[0] eq 'nameserver' && $pair[1] ne '') { + push @nameservers, $pair[1]; + } } } splice @rtable, 0, 2;