From 3fe8a2d7937a36ff1397a786f2b84ae94af27cb2 Mon Sep 17 00:00:00 2001 From: wanghuaz Date: Wed, 18 Nov 2009 12:24:20 +0000 Subject: [PATCH] fixed defect 2898964. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4608 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/perl/xCAT/PPC.pm | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/PPC.pm b/xCAT-server/lib/perl/xCAT/PPC.pm index 40ef00aac..27797282a 100644 --- a/xCAT-server/lib/perl/xCAT/PPC.pm +++ b/xCAT-server/lib/perl/xCAT/PPC.pm @@ -304,10 +304,10 @@ sub process_command { } } - foreach ( @$nodes ) { - if ( $node->{$_}->{reachable} ) { + foreach my $n ( @$nodes ) { + if ( $node->{$n}->{reachable} ) { my $output; - my $IP = xCAT::Utils::toIP( $_ ); + my $IP = xCAT::Utils::toIP( $n ); if ( xCAT::Utils->isAIX() ) { $output = `/usr/sbin/arp -a`; } else { @@ -326,9 +326,9 @@ sub process_command { if ( $mac) { my @mac_sections = split /:/, $mac; - for (@mac_sections) + for my $m (@mac_sections) { - $_ = "0$_" if ( length($_) == 1); + $m = "0$m" if ( length($m) == 1); } $mac = join ':', @mac_sections; } @@ -349,17 +349,14 @@ sub process_command { # Write adapter mac to database ##################################### my $mactab = xCAT::Table->new( "mac", -create=>1, -autocommit=>1 ); - $mactab->setNodeAttribs( $_,{mac=>$mac} ); + $mactab->setNodeAttribs( $n,{mac=>$mac} ); $mactab->close(); } - $callback->({data=>["$_:"]}); - $callback->({data=>["#IP MAC"]}); - $callback->({data=>["$ip $mac\n"]}); - $callback->({node=>[{name=>[$_],data=>["\n#IP MAC\n$ip $mac\n"]}]}); + $callback->({node=>[{name=>[$n],data=>["\n#IP MAC\n$ip $mac\n"]}]}); } } else { - $unreachable_nodes = join (",", $_, $unreachable_nodes); + $unreachable_nodes = join (",", $n, $unreachable_nodes); } } $callback->({data=>["Unreachable Nodes:"]});