2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-14 10:20:31 +00:00

Move the unsupported call to each command support to control what is supported and unsupported at a finer level

This commit is contained in:
Victor Hu
2017-03-20 12:18:03 -04:00
parent 7b227192f6
commit b045fe79f0

View File

@ -273,11 +273,7 @@ sub process_request {
sub parse_args {
my $command = shift;
my $extrargs = shift;
my $check = unsupported($callback);
if (ref($check) eq "ARRAY") {
return $check;
}
my $check = undef;
if (scalar(@ARGV) > 1) {
return ([ 1, "Only one option is supported at the same time" ]);
@ -285,6 +281,12 @@ sub parse_args {
my $subcommand = $ARGV[0];
if ($command eq "rpower") {
#
# disable function until fully tested
#
$check = unsupported($callback);
if (ref($check) eq "ARRAY") { return $check; }
if (!defined($extrargs)) {
return ([ 1, "No option specified for rpower" ]);
}
@ -294,6 +296,13 @@ sub parse_args {
}
if ($command eq "rinv") {
#
# disable function until fully tested
#
$check = unsupported($callback);
if (ref($check) eq "ARRAY") { return $check; }
unless ($subcommand =~ /^cpu$|^dimm$|^bios$|^all$/) {
return ([ 1, "Only 'cpu','dimm', 'bios','all' are supported currently" ]);
}