From 5b6570bd4e5ebc87a3eaa1ecf5a8757b03144c0e Mon Sep 17 00:00:00 2001 From: cxhong Date: Thu, 19 Sep 2019 09:40:31 -0400 Subject: [PATCH] Handle the bad return code if rinstall only run on one node and failed on nodeset --- xCAT-server/lib/xcat/plugins/rinstall.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/rinstall.pm b/xCAT-server/lib/xcat/plugins/rinstall.pm index 52fcc4e27..2eed25a01 100644 --- a/xCAT-server/lib/xcat/plugins/rinstall.pm +++ b/xCAT-server/lib/xcat/plugins/rinstall.pm @@ -387,6 +387,16 @@ sub rinstall { xCAT::MsgUtils->message("I", $rsp, $callback); } + # if only provision one node and failed nodeset, will exit the command + # instead of continue with rnetboot/rsetboot, rpower. + if (scalar(@nodes) == 1) { + $rsp->{error}->[0] = "Failed to run 'nodeset' against the node: @nodes"; + $rsp->{errorcode}->[0] = 1; + xCAT::MsgUtils->message("E", $rsp, $callback); + return 1; + } + + foreach my $node (@failurenodes) { delete $nodes{$node}; }