From 5d13aa4cf43953366f759ca0a296868730809629 Mon Sep 17 00:00:00 2001 From: penguhyang Date: Thu, 20 Oct 2016 01:10:07 -0400 Subject: [PATCH] fix rinv should return correct warning message when the option is not valid --- xCAT-server/lib/xcat/plugins/ipmi.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index a763bad68..b4fd10250 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -2460,6 +2460,7 @@ sub beacon_answer { sub inv { my $sessdata = shift; + my $command = $sessdata->{command}; my $subcommand = $sessdata->{subcommand}; my $rc = 0; @@ -2515,9 +2516,9 @@ sub inv { @types = qw(guid); } else { - @types = ($subcommand); - - #return(1,"unsupported BMC inv argument $subcommand"); + my $usage_string = xCAT::Usage->getUsage($command); + $callback->({ error => ["$usage_string"], errorcode => [1] }); + return 1; } $sessdata->{invtypes} = \@types; initfru($sessdata);