From 854babe0c5958cea4924c8a4411794131f9cc360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Wed, 22 Jul 2026 19:59:15 -0300 Subject: [PATCH] fix(rspconfig): clearer error when no option is given Running rspconfig against an mgt=ipmi node with no option fell through to the generic "Unsupported command: rspconfig " message (with an empty option), which does not tell the user what is wrong. Detect the empty option in preprocess_request and report that options are required. Recovered from the unmerged lenovobuild branch (original 08ae94bd). Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com> --- xCAT-server/lib/xcat/plugins/ipmi.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 7cd34129c..8baf95b55 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -8404,6 +8404,15 @@ sub preprocess_request { $option = $_; $optset = 0; } + if ($option eq '') { + 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; + } 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);