From 08ae94bdc2b0d6c28a3ebc80bf9114b451b07429 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 3 Oct 2018 16:45:40 -0400 Subject: [PATCH] Provide a better error message on rspconfig without arguments --- xCAT-server/lib/xcat/plugins/ipmi.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 05077b9df..4c06e3f99 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -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);