diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 746de86a7..1c11b94ad 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -741,17 +741,17 @@ sub preprocess_request { # Request usage for openbmc sections only $usage_string = xCAT::Usage->parseCommand($command . ".openbmc", @exargs); - if ($usage_string =~ /cannot be found/) { - # Could not find usage for openbmc section, try getting usage for all sections - $usage_string = xCAT::Usage->parseCommand($command, @exargs); - } - else { - # Usage for openbmc section was extracted, append autogenerated usage for - # configured commands - $usage_string .= &build_config_api_usage($callback, $command); - } - if ($usage_string) { + if ($usage_string =~ /cannot be found/) { + # Could not find usage for openbmc section, try getting usage for all sections + $usage_string = xCAT::Usage->parseCommand($command, @exargs); + } + else { + # Usage for openbmc section was extracted, append autogenerated usage for + # configured commands + $usage_string .= &build_config_api_usage($callback, $command); + } + $callback->({ data => [$usage_string] }); $request = {}; return;