From c45cad105c5967697f5791333339476ac1febd1c Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 16 Mar 2010 20:40:19 +0000 Subject: [PATCH] -Move bind.pm out of searchpath -Make dns.pm potentially work git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5489 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- .../xcat/plugins/{bind.pm => bind.pm.legacy} | 0 xCAT-server/lib/xcat/plugins/dns.pm.exp | 47 ++++++++++++++++++- 2 files changed, 46 insertions(+), 1 deletion(-) rename xCAT-server/lib/xcat/plugins/{bind.pm => bind.pm.legacy} (100%) diff --git a/xCAT-server/lib/xcat/plugins/bind.pm b/xCAT-server/lib/xcat/plugins/bind.pm.legacy similarity index 100% rename from xCAT-server/lib/xcat/plugins/bind.pm rename to xCAT-server/lib/xcat/plugins/bind.pm.legacy diff --git a/xCAT-server/lib/xcat/plugins/dns.pm.exp b/xCAT-server/lib/xcat/plugins/dns.pm.exp index 3f075f054..7ce68e327 100644 --- a/xCAT-server/lib/xcat/plugins/dns.pm.exp +++ b/xCAT-server/lib/xcat/plugins/dns.pm.exp @@ -9,6 +9,10 @@ use strict; my $callback; +sub handled_commands +{ + return {"makedns" => "dns"}; +} sub get_reverse_zone_for_entity { my $ctx = shift; my $node = shift; @@ -509,5 +513,46 @@ sub find_nameserver_for_dns { } } sub sendmsg { - print Dumper(@_); +# my $callback = $output_handler; + my $text = shift; + my $node = shift; + my $descr; + my $rc; + if (ref $text eq 'HASH') { + die "not right now"; + } elsif (ref $text eq 'ARRAY') { + $rc = $text->[0]; + $text = $text->[1]; + } + if ($text =~ /:/) { + ($descr,$text) = split /:/,$text,2; + } + $text =~ s/^ *//; + $text =~ s/ *$//; + my $msg; + my $curptr; + if ($node) { + $msg->{node}=[{name => [$node]}]; + $curptr=$msg->{node}->[0]; + } else { + $msg = {}; + $curptr = $msg; + } + if ($rc) { + $curptr->{errorcode}=[$rc]; + $curptr->{error}=[$text]; + $curptr=$curptr->{error}->[0]; + if (defined $node) { + $allerrornodes{$node}=1; + } + } else { + $curptr->{data}=[{contents=>[$text]}]; + $curptr=$curptr->{data}->[0]; + if ($descr) { $curptr->{desc}=[$descr]; } + } +# print $outfd freeze([$msg]); +# print $outfd "\nENDOFFREEZE6sK4ci\n"; +# yield; +# waitforack($outfd); + $callback->($msg); }