From d6b418bfb01ea795b5f01a9980915f94208821a5 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Tue, 12 Mar 2019 05:35:35 -0400 Subject: [PATCH 1/2] Fix issue that site.master is not set --- perl-xCAT/xCAT/ServiceNodeUtils.pm | 4 ++++ xCAT-server/sbin/xcatd | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/perl-xCAT/xCAT/ServiceNodeUtils.pm b/perl-xCAT/xCAT/ServiceNodeUtils.pm index c89fcfe31..6cf783de6 100755 --- a/perl-xCAT/xCAT/ServiceNodeUtils.pm +++ b/perl-xCAT/xCAT/ServiceNodeUtils.pm @@ -555,6 +555,10 @@ sub get_ServiceNode { push @{ $snhash{$master} }, $node; } + else + { + xCAT::MsgUtils->message('SW', "Unknown master for node: $node, neither noderes.servicenode nor site.master is set\n"); + } } } diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 71aa7bc75..e640240a1 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -2283,6 +2283,10 @@ sub dispatch_request { $SIG{CHLD} = 'DEFAULT'; xCAT::MsgUtils->trace(0, "D", "xcatd: handle request '$req->{command}->[0]' by plugin '$modname''s preprocess_request"); $reqs = ${ "xCAT_plugin::" . $modname . "::" }{preprocess_request}->($req, $dispatch_cb, \&do_request); + if (not(scalar @$reqs) and not(defined xCAT::TableUtils->get_site_attribute('master'))) { + $dispatch_cb->({ error => ['No site.master set, please check'], errorcode => [1] }); + return; + } } else { # otherwise, pass it in without hierarchy support $reqs = [$req]; } From a56305ebeb3f666e5037818d64600d11ac583b45 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Tue, 12 Mar 2019 21:35:06 -0400 Subject: [PATCH 2/2] Update warning message based on Victor's comments --- xCAT-server/sbin/xcatd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index e640240a1..849ce02be 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -2284,7 +2284,7 @@ sub dispatch_request { xCAT::MsgUtils->trace(0, "D", "xcatd: handle request '$req->{command}->[0]' by plugin '$modname''s preprocess_request"); $reqs = ${ "xCAT_plugin::" . $modname . "::" }{preprocess_request}->($req, $dispatch_cb, \&do_request); if (not(scalar @$reqs) and not(defined xCAT::TableUtils->get_site_attribute('master'))) { - $dispatch_cb->({ error => ['No site.master set, please check'], errorcode => [1] }); + $dispatch_cb->({ warning => ["The 'master' attribute is not set in the site table and may cause unexpected behavior."]}); return; } } else { # otherwise, pass it in without hierarchy support