2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-16 03:10:36 +00:00

modify nodeset return code for hierarchy support

This commit is contained in:
cxhong
2019-10-17 17:48:59 -04:00
parent 94fcb1a9d6
commit fee95d4882

View File

@ -389,14 +389,18 @@ sub rinstall {
# if only provision one node and failed nodeset, will exit the command
# instead of continue with rnetboot/rsetboot, rpower.
# check if it is hierarchy cluster
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;
my $nrtab = xCAT::Table->new('noderes');
my $sn = $nrtab->getNodeAttribs(@nodes,['servicenode']);
if (!$sn) {
$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};
}