From e5643353eb3108f0fa8402fdc0fc9665402bec05 Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Fri, 5 Aug 2011 06:52:14 +0000 Subject: [PATCH] fix bugs 3386134, parse_lparname function is not located at a correct position git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10230 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/FSPvm.pm | 42 ++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/perl-xCAT/xCAT/FSPvm.pm b/perl-xCAT/xCAT/FSPvm.pm index 5e7e97081..7f7e54486 100644 --- a/perl-xCAT/xCAT/FSPvm.pm +++ b/perl-xCAT/xCAT/FSPvm.pm @@ -59,7 +59,7 @@ sub chvm_parse_lparname { return "'$cmd' not support"; } if (!defined($value)) { - return "value not specify"; + return "value not specified"; } $opt->{$cmd} = $value; if ($value && $value ne '*' && $value !~ /^[a-zA-Z0-9-_]+$/) { @@ -107,26 +107,6 @@ sub chvm_parse_args { return(usage( "Missing option: -" )); } #################################### - # Check for an extra argument - #################################### - if ( defined( $ARGV[0] )) { - my $check_chvm_lpar_arg = chvm_parse_lparname(\@ARGV, \%opt); - if (defined($check_chvm_lpar_arg)) { - return (usage("Invalid argument: $check_chvm_lpar_arg")); - } elsif (($opt{lparname} ne '*') && (scalar(@{$request->{node}}) > '1')){ - return(usage( "Invalid argument: must specify '*' for more than one node" )); - } else { - my $len = rindex $opt{lparname}."\$", "\$"; - if ($len > '47') { - return (usage("Invalid lparname '$opt{lparname}', name is too long, max 47 characters")); - } - } - if (exists($opt{lparname}) && - (exists($opt{p}) || exists($opt{i}) || exists($opt{m}) || exists($opt{r}))) { - return (usage("lparname should NOT be used with -p, -i, -m or -r.")); - } - } - #################################### # Configuration file required #################################### #if ( !exists( $opt{p}) ) { @@ -310,6 +290,26 @@ sub chvm_parse_args { $request->{node} = [$other_p]; $request->{noderange} = $other_p; } + #################################### + # Check for an extra argument + #################################### + if ( defined( $ARGV[0] )) { + my $check_chvm_lpar_arg = chvm_parse_lparname(\@ARGV, \%opt); + if (defined($check_chvm_lpar_arg)) { + return (usage("Invalid argument: $check_chvm_lpar_arg")); + } elsif (($opt{lparname} ne '*') && (scalar(@{$request->{node}}) > '1')){ + return(usage( "Invalid argument: must specify '*' for more than one node" )); + } else { + my $len = rindex $opt{lparname}."\$", "\$"; + if ($len > '47') { + return (usage("Invalid lparname '$opt{lparname}', name is too long, max 47 characters")); + } + } + if (exists($opt{lparname}) && + (exists($opt{p}) || exists($opt{i}) || exists($opt{m}) || exists($opt{r}))) { + return (usage("lparname should NOT be used with -p, -i, -m or -r.")); + } + } #################################### # No operands - add command name