From 7b227192f626d2f3a2d4c4819ce8de75fbe8dca9 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 20 Mar 2017 12:10:03 -0400 Subject: [PATCH] Move the rpower usage checking under the rpower option --- xCAT-server/lib/xcat/plugins/openbmc.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 8505125d0..95e332bd8 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -279,16 +279,15 @@ sub parse_args { return $check; } - if (!defined($extrargs)) { - return ([ 1, "No option specified for rpower" ]); - } - if (scalar(@ARGV) > 1) { return ([ 1, "Only one option is supported at the same time" ]); } my $subcommand = $ARGV[0]; if ($command eq "rpower") { + if (!defined($extrargs)) { + return ([ 1, "No option specified for rpower" ]); + } unless ($subcommand =~ /^on$|^off$|^reset$|^boot$|^status$|^stat$|^state$/) { return ([ 1, "$subcommand is not supported for rpower" ]); }