From ccf2a60970272a2fd938c04c4f8b74b43745a752 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Mon, 20 Jun 2011 09:12:38 +0000 Subject: [PATCH] fix bugs for bugs item 3316413 and 3316669 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9857 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/FSPvm.pm | 8 ++++++-- xCAT-client/pods/man1/rspconfig.1.pod | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/perl-xCAT/xCAT/FSPvm.pm b/perl-xCAT/xCAT/FSPvm.pm index 391b48e33..5d03710cc 100644 --- a/perl-xCAT/xCAT/FSPvm.pm +++ b/perl-xCAT/xCAT/FSPvm.pm @@ -201,13 +201,16 @@ sub chvm_parse_args { my @elems = split(/\,/,$opt{r}); my $range=""; while (my $elem = shift @elems) { + if ($elem !~ /\:/) { + return (usage("Invalid argument $elem.\n The input format for 'r' should be like this: \"-r Octant_id:Value\".")) + } if($elem !~ /\-/) { my @subelems = split(/\:/, $elem); if( $subelems[0] < 0 || $subelems[0] > 7) { return(usage("Octant ID only could be 0 to 7 in the octant configuration value $elem")); } if( grep(/^$subelems[1]$/, @ratio ) != 1) { - return(usage( "Invalid octant configuration value in $elem.\n For P7 IH, octant configuration values only could be 1, 2, 3, 4, 5. Please see the details in manpage of mkvm." )); + return(usage( "Invalid octant configuration value in $elem.\n For P7 IH, octant configuration values only could be 1, 2, 3, 4, 5. Please see the details in manpage of chvm." )); } if( exists($octant_cfg{$subelems[0]}) && $octant_cfg{$subelems[0]} == $subelems[1] ) { return(usage("In the octant configuration rule, same octant with different octant configuration value. Error!")); @@ -222,7 +225,7 @@ sub chvm_parse_args { } if($left == $right) { if( grep(/^$subelems[1]$/, @ratio ) != 1) { - return(usage( "Invalid octant configuration value in $elem.\n For P7 IH, octant configuration values only could be 1, 2, 3, 4, 5. Please see the details in manpage of mkvm." )); + return(usage( "Invalid octant configuration value in $elem.\n For P7 IH, octant configuration values only could be 1, 2, 3, 4, 5. Please see the details in manpage of chvm." )); } if( exists($octant_cfg{$left}) || $octant_cfg{$left} == $subelems[1] ) { return(usage("In the octant configuration rule, same octant with different octant configuration value. Error!")); @@ -579,6 +582,7 @@ sub modify { my $hash = shift; return modify_by_prof( $request, $hash) if ( $request->{opt}->{p}); return create( $request, $hash) if ( $request->{opt}->{i}); + return ([["Error", "Miss argument"]]); } diff --git a/xCAT-client/pods/man1/rspconfig.1.pod b/xCAT-client/pods/man1/rspconfig.1.pod index 72160a47f..a0fbb8a11 100644 --- a/xCAT-client/pods/man1/rspconfig.1.pod +++ b/xCAT-client/pods/man1/rspconfig.1.pod @@ -157,7 +157,7 @@ B I B<--resetnet> B configures various settings in the nodes' service processors. If only a keyword is specified, without the B<=>, it displays the current value. -For options B|B|B|B|B|B|B|B