From ff00b0716e850638064863ceec6f7a3fe6c2683c Mon Sep 17 00:00:00 2001 From: wanghuaz Date: Tue, 6 Mar 2012 07:51:22 +0000 Subject: [PATCH] Added getmacs -M option to disable mac address failover git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11758 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/FSPmac.pm | 4 ++++ perl-xCAT/xCAT/PPCmac.pm | 2 +- perl-xCAT/xCAT/Usage.pm | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/FSPmac.pm b/perl-xCAT/xCAT/FSPmac.pm index c69358a9a..07fc46149 100644 --- a/perl-xCAT/xCAT/FSPmac.pm +++ b/perl-xCAT/xCAT/FSPmac.pm @@ -349,6 +349,10 @@ sub getmacs { if( $mac_addr ) { $mac_addr = format_mac($mac_addr); } + if ( !exists( $opt->{M} )) { + my @mac_addrs = split /\|/, $mac_addr; + $mac_addr = @mac_addrs[0]; + } $att{'MAC_Address'} = ($mac_addr) ? $mac_addr : "N/A"; $att{'Adapter'} = ($adapter_id) ? $adapter_id : "N/A"; $att{'Port_Group'} = ($port_group) ? $port_group : "N/A"; diff --git a/perl-xCAT/xCAT/PPCmac.pm b/perl-xCAT/xCAT/PPCmac.pm index 7dbdcb23a..724d9c584 100644 --- a/perl-xCAT/xCAT/PPCmac.pm +++ b/perl-xCAT/xCAT/PPCmac.pm @@ -46,7 +46,7 @@ sub parse_args { $Getopt::Long::ignorecase = 0; Getopt::Long::Configure( "bundling" ); - if ( !GetOptions( \%opt,qw(h|help V|Verbose v|version C=s G=s S=s D d f o F=s arp))) { + if ( !GetOptions( \%opt,qw(h|help V|Verbose v|version C=s G=s S=s D d f M o F=s arp))) { return( usage() ); } #################################### diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 6ae4dfa8a..4f18d8840 100644 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -181,6 +181,7 @@ my %usage = ( getmacs [-h|--help|-v|--version] PPC specific: getmacs [-F filter] + getmacs [-M] getmacs [-V| --verbose] [-f] [-d] [--arp] | [-D [-S server] [-G gateway] [-C client]] blade specific: getmacs [-V| --verbose] [-d] [--arp]