From 066d705b64fb8964e0d0f7e2f3308feb750882e5 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 27 Mar 2009 03:33:59 +0000 Subject: [PATCH] Fix 3com logic and BNT port detection git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3009 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/MacMap.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/perl-xCAT/xCAT/MacMap.pm b/perl-xCAT/xCAT/MacMap.pm index 3acb0bb0d..b78f93588 100644 --- a/perl-xCAT/xCAT/MacMap.pm +++ b/perl-xCAT/xCAT/MacMap.pm @@ -45,16 +45,16 @@ OID, and have the switch table port value match exactly the format suggested by } #Begin guessing, first off, all tested scenarios have likely correct guesses ending #in the cfg string, with some non-numeric prefix before it. - unless ($namepersnmp =~ /[^0123456789]$namepercfg\z/) { - #Most common case, won't match at all - return 0; - } #3com convention, contributed by Aaron Knister if ( $namepersnmp =~ /^RMON Port (0?)(\d+) on unit \d+/ ) { if ( $2 =~ $namepercfg ) { return 1; } } + unless ($namepersnmp =~ /[^0123456789]$namepercfg\z/) { + #Most common case, won't match at all + return 0; + } #stop contemplating vlan, Nu, stacking ports, and console interfaces if (($namepersnmp =~ /vl/i) or ($namepersnmp =~ /Nu/) or ($namepersnmp =~ /onsole/) or ($namepersnmp =~ /Stack/)) { @@ -62,7 +62,7 @@ OID, and have the switch table port value match exactly the format suggested by } #broken up for code readablitiy, don't check port channel numbers or CPU #have to distinguish betweer Port and Po and PortChannel - if (($namepersnmp !~ /Port #/) and ($namepersnmp !~ /Port\d/) and ($namepersnmp =~ /Po/) or ($namepersnmp =~ /LAG/) or ($namepersnmp =~ /CPU/)) { + if (($namepersnmp !~ /Port #/) and ($namepersnmp !~ /Port\d/) and ($namepersnmp =~ /Po/) or ($namepersnmp =~ /po\d/) or ($namepersnmp =~ /XGE/) or ($namepersnmp =~ /LAG/) or ($namepersnmp =~ /CPU/)) { return 0; } #don't contemplate ManagementEthernet