From 3281adc8a22132cb29410c27687a9401971b0c3c Mon Sep 17 00:00:00 2001 From: sakolish Date: Wed, 16 Apr 2008 18:00:18 +0000 Subject: [PATCH] Grouped /^(fsp|bpa)$/ in regexp git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1097 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT-2.0/xCAT/PPCpower.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/perl-xCAT-2.0/xCAT/PPCpower.pm b/perl-xCAT-2.0/xCAT/PPCpower.pm index ded6a1c5c..9bd70f729 100644 --- a/perl-xCAT-2.0/xCAT/PPCpower.pm +++ b/perl-xCAT-2.0/xCAT/PPCpower.pm @@ -21,8 +21,8 @@ sub parse_args { # Responds with usage statement ############################################# local *usage = sub { - my $usage_string=xCAT::Usage->getUsage($command); - return( [ $_[0], $usage_string]); + my $usage_string = xCAT::Usage->getUsage($command); + return( [ $_[0], $usage_string] ); }; ############################################# # Process command-line arguments @@ -117,7 +117,7 @@ sub enumerate { ############################## # No lparid for fsp/bpa ############################## - if ( $type =~ /^fsp|bpa$/ ) { + if ( $type =~ /^(fsp|bpa)$/ ) { $lparid = $type; } $outhash{ $lparid } = $state; @@ -160,7 +160,7 @@ sub powercmd_boot { # Look up by lparid ################################## my $type = @$d[4]; - my $id = ($type=~/^fsp|bpa$/) ? $type : @$d[0]; + my $id = ($type=~/^(fsp|bpa)$/) ? $type : @$d[0]; ################################## # Output error @@ -180,7 +180,7 @@ sub powercmd_boot { # Convert state to on/off ################################## my $state = power_status($data->{$id}); - my $op = ($state =~ /^Off|Not Activated$/) ? "on" : "reset"; + my $op = ($state =~ /^(Off|Not Activated)$/) ? "on" : "reset"; ############################## # Send power command @@ -276,7 +276,7 @@ sub state { # Look up by lparid ################################## my $type = @$d[4]; - my $id = ($type=~/^fsp|bpa$/) ? $type : @$d[0]; + my $id = ($type=~/^(fsp|bpa)$/) ? $type : @$d[0]; ################################## # Output error