2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-09-07 02:38:15 +00:00

Provide a better error message on rspconfig without arguments

This commit is contained in:
Jarrod Johnson
2018-10-03 16:45:40 -04:00
parent 086b0c0db7
commit 08ae94bdc2

View File

@@ -8399,6 +8399,16 @@ sub preprocess_request {
$option = $_;
$optset = 0;
}
if ($option eq '') {
my $error_data = "";
foreach (@$all_noderange) {
$error_data .= "\n" if ($error_data);
$error_data .= "$_: options are required when using mgt=ipmi, see -h or the man page";
}
$callback->({ errorcode => [1], data => [ $error_data ] });
$request = {};
return 0;
}
unless ($option =~ /^USERID$|^ip$|^netmask$|^gateway$|^vlan$|^userid$|^username$|^password$|^snmpdest|^thermprofile$|^alert$|^garp$|^community$|^backupgateway$/) {
foreach (@$all_noderange) {
$error_data .= "\n" if ($error_data);