From ff1fc8d5988b8843789b5f386ba3f7e32accd993 Mon Sep 17 00:00:00 2001 From: sakolish Date: Wed, 16 Apr 2008 18:10:41 +0000 Subject: [PATCH] Grouped /^(lpar|fsp)$/ in regexp git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1101 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT-2.0/xCAT/PPCvm.pm | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/perl-xCAT-2.0/xCAT/PPCvm.pm b/perl-xCAT-2.0/xCAT/PPCvm.pm index 07eb08676..5f12ac5fe 100644 --- a/perl-xCAT-2.0/xCAT/PPCvm.pm +++ b/perl-xCAT-2.0/xCAT/PPCvm.pm @@ -49,8 +49,8 @@ sub chvm_parse_args { # Responds with usage statement ############################################# local *usage = sub { - my $usage_string=xCAT::Usage->getUsage($cmd); - return( [ $_[0], $usage_string]); + my $usage_string = xCAT::Usage->getUsage($cmd); + return( [ $_[0], $usage_string] ); }; #################################### # Configuration file required @@ -111,8 +111,8 @@ sub mkvm_parse_args { # Responds with usage statement ############################################# local *usage = sub { - my $usage_string=xCAT::Usage->getUsage($cmd); - return( [ $_[0], $usage_string]); + my $usage_string = xCAT::Usage->getUsage($cmd); + return( [ $_[0], $usage_string] ); }; ############################################# # Process command-line arguments @@ -148,7 +148,7 @@ sub mkvm_parse_args { # Check for non-zero integer #################################### if ( exists( $opt{i} )) { - if ( $opt{i} !~ /^[1-9]{1}|[1-9]{1}[0-9]+$/ ) { + if ( $opt{i} !~ /^([1-9]{1}|[1-9]{1}[0-9]+)$/ ) { return(usage( "Invalid entry: $opt{i}" )); } @@ -196,8 +196,8 @@ sub rmvm_parse_args { # Responds with usage statement ############################################# local *usage = sub { - my $usage_string=xCAT::Usage->getUsage($cmd); - return( [ $_[0], $usage_string]); + my $usage_string = xCAT::Usage->getUsage($cmd); + return( [ $_[0], $usage_string] ); }; ############################################# # Process command-line arguments @@ -252,8 +252,8 @@ sub lsvm_parse_args { # Responds with usage statement ############################################# local *usage = sub { - my $usage_string=xCAT::Usage->getUsage($cmd); - return( [ $_[0], $usage_string]); + my $usage_string = xCAT::Usage->getUsage($cmd); + return( [ $_[0], $usage_string] ); }; ############################################# # Process command-line arguments @@ -504,7 +504,7 @@ sub remove { #################################### # Must be CEC or LPAR #################################### - if ( $type !~ /^lpar|fsp$/ ) { + if ( $type !~ /^(lpar|fsp)$/ ) { push @values, [$lpar, "Node must be LPAR or CEC", RC_ERROR]; next; } @@ -655,7 +655,7 @@ sub list { #################################### # Must be CEC or LPAR #################################### - if ( $type !~ /^lpar|fsp$/ ) { + if ( $type !~ /^(lpar|fsp)$/ ) { push @values, [$lpar,"Node must be LPAR or CEC",RC_ERROR]; next; } @@ -750,7 +750,7 @@ sub create { ##################################### # Must be CEC or LPAR ##################################### - if ( $type !~ /^lpar|fsp$/ ) { + if ( $type !~ /^(lpar|fsp)$/ ) { push @values, [$lpar,"Node must be LPAR or CEC",RC_ERROR]; next; } @@ -972,3 +972,4 @@ sub lsvm { +