diff --git a/xCAT-probe/subcmds/image b/xCAT-probe/subcmds/image index b480324a9..c9837ac89 100755 --- a/xCAT-probe/subcmds/image +++ b/xCAT-probe/subcmds/image @@ -13,7 +13,7 @@ use warnings; my $program_name = basename("$0"); my $help; -my $installnic; +my $noderange = ""; my $test; my $output = "stdout"; my $verbose = 0; @@ -22,7 +22,7 @@ my $rst = 0; $::USAGE = "Usage: $program_name -h $program_name -T - $program_name {-c|-d} [-V] [noderange] + $program_name {-c|-d} [-n noderange] [-V] Description: Use this command to check if diskless, pingable compute nodes have the same images installed as defines in xCAT DB. @@ -31,6 +31,7 @@ Description: Options: -h : Get usage information of $program_name -T : To verify if $program_name can work, reserve option for probe framework + -n : Range of nodes to check -d : To verify diskless, pingable compute nodes have the same images installed as defines in xCAT DB. -c : To verify all diskless, pingable compute nodes have the identical images installed. -V : To print additional debug information. @@ -41,10 +42,11 @@ Options: #------------------------------------- if ( !GetOptions("--help|h" => \$help, - "T" => \$test, - "V" => \$VERBOSE, - "c" => \$CONSISTENCY_CHECK, - "d" => \$DEFINITION_CHECK)) + "T" => \$test, + "V" => \$VERBOSE, + "n=s" => \$noderange, + "c" => \$CONSISTENCY_CHECK, + "d" => \$DEFINITION_CHECK)) { probe_utils->send_msg("$output", "f", "Invalid parameter for $program_name"); probe_utils->send_msg("$output", "d", "$::USAGE"); @@ -71,6 +73,14 @@ unless (defined($CONSISTENCY_CHECK) || defined($DEFINITION_CHECK)) { exit 1; } +if (scalar(@ARGV) >= 1) { + # After processing all the expected flags and arguments, + # there is still left over stuff on the command line + probe_utils->send_msg("$output", "f", "Invalid flag or parameter: @ARGV"); + probe_utils->send_msg("$output", "d", "$::USAGE"); + exit 1; +} + my @pingable_nodes; my @diskless_nodes; my $na = "N/A"; @@ -80,7 +90,7 @@ my %node_defined_image_uuid_hash; my %node_defined_image_name_hash; my %osimage_defined_provmethod_hash; -my $all_nodes_provmethod = `lsdef -i provmethod -c @ARGV`; +my $all_nodes_provmethod = `lsdef -i provmethod -c $noderange`; my $all_osimage_provmethod = `lsdef -t osimage -i provmethod,rootimgdir -c`; chomp($all_nodes_provmethod); my @all_nodes_provmethod_lines = split("[\n\r]", $all_nodes_provmethod);