From bfa93c73f07c12c148cff22e4ddc7230df6c8947 Mon Sep 17 00:00:00 2001 From: sjing Date: Fri, 13 May 2011 07:31:18 +0000 Subject: [PATCH] make the default value of networks.nameservers empty. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9591 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/ddns.pm | 2 ++ xCAT-server/lib/xcat/plugins/dhcp.pm | 10 +----- xCAT-server/lib/xcat/plugins/networks.pm | 44 ++---------------------- 3 files changed, 5 insertions(+), 51 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index f9a966299..f016d48b9 100644 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -834,6 +834,8 @@ sub add_or_delete_records { if ($numreqs != 300) { #either no entries at all to begin with or a perfect multiple of 300 $update->sign_tsig("xcat_key",$ctx->{privkey}); my $reply = $resolver->send($update); + # sometimes resolver does not work if the update zone request sent so quick + sleep 1; } } } diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 8723045ec..c1d6a7a64 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -1528,15 +1528,7 @@ sub addnet } if ($ent and $ent->{nameservers}) { - # convert to nameserver IP - if ($ent->{nameservers} eq '') - { - $nameservers = xCAT::InstUtils->convert_xcatmaster(); - } - else - { - $nameservers = $ent->{nameservers}; - } + $nameservers = $ent->{nameservers}; } else { diff --git a/xCAT-server/lib/xcat/plugins/networks.pm b/xCAT-server/lib/xcat/plugins/networks.pm index bd89db921..e5d228101 100644 --- a/xCAT-server/lib/xcat/plugins/networks.pm +++ b/xCAT-server/lib/xcat/plugins/networks.pm @@ -365,28 +365,7 @@ sub donets # For Linux systems my @ip6table = split /\n/,`/sbin/ip -6 route`; my @rtable = split /\n/, `/bin/netstat -rn`; - open($rconf, "/etc/resolv.conf"); - my @nameservers; - if ($rconf) - { - my @rcont; - while (<$rconf>) - { - push @rcont, $_; - } - close($rconf); - foreach (grep /nameserver/, @rcont) - { - 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; my %netgw = (); @@ -539,26 +518,7 @@ sub donets $nettab->setAttribs({'net' => $net, 'mask' => $mask}, {'netname' => $netname, 'mgtifname' => $mgtifname, 'gateway' => $gw}); } } - - my $tent = $nettab->getAttribs({'net' => $net, 'mask' => $mask}, 'nameservers'); - - # convert to nameserver IP - if ($tent->{nameservers} eq '') - { - $tent->{nameservers} = xCAT::InstUtils->convert_xcatmaster(); - } - - unless ($tent and $tent->{nameservers}) - { - my $text = join ',', @nameservers; - if ($::DISPLAY) { - push @{$rsp->{data}}, " nameservers=$text"; - } else { - if (!$foundmatch) { - $nettab->setAttribs({'net' => $net, 'mask' => $mask}, {nameservers => $text}); - } - } - } + unless ($tent and $tent->{tftpserver}) { my $netdev = $ent[7];