Fixed a getmacs issue 3294236 in 2.6.6

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9470 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
wanghuaz 2011-05-03 06:14:03 +00:00
parent d3a70cefa2
commit 631a625666
2 changed files with 12 additions and 10 deletions

View File

@ -580,10 +580,11 @@ sub format_mac {
# Get adapter mac
#####################################
my @newmacs;
my $newmac = $mac;
my @macs = split /\|/, $mac;
foreach my $mac_a ( @macs ) {
if ( !xCAT::Utils->isAIX() ) {
if ( !xCAT::Utils->isAIX() ) {
foreach my $mac_a ( @macs ) {
#################################
# Delineate MAC with colons
#################################
@ -592,9 +593,9 @@ sub format_mac {
$mac_a =~ s/:$//;
push @newmacs, $mac_a;
}
$newmac = join("|",@newmacs);
}
my $newmac = join("|",@newmacs);
return( "$newmac" );

View File

@ -741,17 +741,18 @@ sub cal_mac {
##########################################################################
sub format_mac {
my $mac = shift;
#my $data = shift;
my $data = shift;
$data =~ /^(\S+\s+\S+\s+)(\S+)(\s+.*)$/;
my $mac = $2;
#####################################
# Get adapter mac
#####################################
my @newmacs;
my @macs = split /\|/, $mac;
foreach my $mac_a ( @macs ) {
if ( !xCAT::Utils->isAIX() ) {
if ( !xCAT::Utils->isAIX() ) {
foreach my $mac_a ( @macs ) {
#################################
# Delineate MAC with colons
#################################
@ -760,11 +761,11 @@ sub format_mac {
$mac_a =~ s/:$//;
push @newmacs, $mac_a;
}
my $newmac = join("|",@newmacs);
$data =~ s/$mac/$newmac/;
}
my $newmac = join("|",@newmacs);
return( "$newmac" );
return( "$data\n" );
}