2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-05-05 08:39:08 +00:00

fix: silent failure with no site master attribute (#7537)

* Fix silent failure when site.master is not set (#6157)

Hardware control commands (rpower, rinv, etc.) silently return no output
and exit 0 when site.master is empty. The original fix (#6074) was
reverted (#6158) because it warned per-node with the wrong hostname.

Check once in plugin_command before dispatching to plugins, so the error
appears exactly once with the correct command name.

* Also reject empty site.master, not only undef
This commit is contained in:
Vinícius Ferrão
2026-05-02 21:39:04 -03:00
committed by GitHub
parent a6145b402b
commit d455b82b1a

View File

@@ -1885,6 +1885,18 @@ sub plugin_command {
}
}
}
my $sitemaster = xCAT::TableUtils->get_site_attribute('master');
if ($req->{node} and not($sitemaster)) {
my $rsp = { error => ["site.master is not set, unable to dispatch '$req->{command}->[0]'"], errorcode => [1] };
$rsp->{serverdone} = [undef];
if ($sock) {
send_response($rsp, $sock);
} else {
$callback->($rsp);
}
return;
}
my %xcatresponses = (xcatresponse => []);
$plugin_numchildren = 0;
%plugin_children = ();