From ce7ed0cb7238cd7f5a631b4af75bf2cb6f800e88 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Mon, 10 Nov 2014 04:26:22 -0500 Subject: [PATCH] Check the version of perl-Net-DNS. If it's perl-Net-DNS-0.73-1.28, output an error message that require the update and return --- xCAT-server/lib/xcat/plugins/ddns.pm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index 8ade8cbf8..8daa58bc7 100755 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -209,6 +209,23 @@ sub process_request { my $deletemode=0; my $external=0; my $slave=0; + + # Since the mandatory rpm perl-Net-DNS for makedns on sles12 (perl-Net-DNS-0.73-1.28) has a bug, + # user has to update it to a newer version + my @rpminfo = `rpm -qi perl-Net-DNS`; + my ($matchedver, $matchedrel); + foreach (@rpminfo) { + if (/Version\s*:\s*0.73/i) { + $matchedver = 1; + } elsif (/Release\s*:\s*1.28/i) { + $matchedrel = 1; + } + } + if ($matchedver && $matchedrel) { + xCAT::MsgUtils->message("E", {error => ["The necessary rpm perl-Net-DNS-0.73-1.28 needs be updated to a higher version for makedns to function. You can get a workable version perl-Net-DNS-0.80-1.x86_64.rpm from xCAT Dependency Repository. e.g. For sles12: zypper install perl-Net-DNS-0.80-1.x86_64"], errorcode => [1]}, $callback); + return; + } + if ($request->{arg}) { $hadargs=1; @ARGV=@{$request->{arg}};