From 22219b3dad997711bba9ad99606f69b80f1a0dd0 Mon Sep 17 00:00:00 2001 From: sjing Date: Thu, 12 May 2011 07:59:51 +0000 Subject: [PATCH] support ddns as the default dnshandler. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9576 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/AAsn.pm | 31 ---------------------------- xCAT-server/lib/xcat/plugins/ddns.pm | 25 ++++------------------ 2 files changed, 4 insertions(+), 52 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/AAsn.pm b/xCAT-server/lib/xcat/plugins/AAsn.pm index 4572b53e3..ae2b4a4fd 100644 --- a/xCAT-server/lib/xcat/plugins/AAsn.pm +++ b/xCAT-server/lib/xcat/plugins/AAsn.pm @@ -716,37 +716,6 @@ sub setup_FTP #----------------------------------------------------------------------------- sub setup_DNS -{ - my $rc = 0; - - # run makedns - my $XCATROOT = "/opt/xcat"; # default - - if ($ENV{'XCATROOT'}) - { - $XCATROOT = $ENV{'XCATROOT'}; - } - my $cmdref; - $cmdref->{command}->[0] = "makedns"; - $cmdref->{arg}->[0] = "-n"; - $cmdref->{arg}->[1] = "-s"; - $cmdref->{cwd}->[0] = "/opt/xcat/sbin"; - - no strict "refs"; - my $modname = "ddns"; - ${"xCAT_plugin::" . $modname . "::"}{process_request} - ->($cmdref, \&xCAT::Client::handle_response); - - my $rc = xCAT::Utils->startService("named"); - if ($rc != 0) - { - return 1; - } - - return $rc; -} - -if(0) { my $XCATROOT = "/opt/xcat"; # default diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index f1ae731a3..f9a966299 100644 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -189,7 +189,6 @@ sub process_request { my $hadargs=0; my $allnodes; my $zapfiles; - my $svcnode; my $help; my $deletemode=0; if ($request->{arg}) { @@ -202,7 +201,6 @@ sub process_request { 'a|all' => \$allnodes, 'n|new' => \$zapfiles, 'd|delete' => \$deletemode, - 's|svcnode' => \$svcnode, # internal flag to indicate makedns is run on the servicenode(e.g. from AAsn.pm). 'h|help' => \$help, )) { #xCAT::SvrUtils::sendmsg([1,"TODO: makedns Usage message"], $callback); @@ -327,25 +325,10 @@ sub process_request { $ctx->{privkey} = $pent->{password}; } #do not warn/error here yet, if we can't generate or extract, we'll know later - # if $svcnode is set, then makedns is run on the servicenode - # we set the forwarder to site.master to always forward unknown requests to the MN - if ($svcnode) - { - # use site.master instead of site.forwarders - $stab = $sitetab->getAttribs({key=>'master'},['value']); - if ($stab and $stab->{value}) { - my @forwarders; - push @forwarders, $stab->{value}; - $ctx->{forwarders} = \@forwarders; - } - } - else - { - $stab = $sitetab->getAttribs({key=>'forwarders'},['value']); - if ($stab and $stab->{value}) { - my @forwarders = split /[ ,]/,$stab->{value}; - $ctx->{forwarders}=\@forwarders; - } + $stab = $sitetab->getAttribs({key=>'forwarders'},['value']); + if ($stab and $stab->{value}) { + my @forwarders = split /[ ,]/,$stab->{value}; + $ctx->{forwarders}=\@forwarders; } $ctx->{zonestotouch}->{$ctx->{domain}}=1; foreach (@nodes) {