From efe77ede936e59b0f364463f9330ac87c925f9d0 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 24 Apr 2008 20:51:06 +0000 Subject: [PATCH] -Implement workaround for BNT Blade switch module firmwares without ifName support git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1197 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT-2.0/xCAT/MacMap.pm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/perl-xCAT-2.0/xCAT/MacMap.pm b/perl-xCAT-2.0/xCAT/MacMap.pm index 3c7463c96..7133a4ca6 100755 --- a/perl-xCAT-2.0/xCAT/MacMap.pm +++ b/perl-xCAT-2.0/xCAT/MacMap.pm @@ -215,8 +215,22 @@ sub refresh_switch { #if ($error) { die $error; } unless ($session) { syslog("err","Failed to communicate with $switch"); return; } my $namemap = walkoid($session,'.1.3.6.1.2.1.31.1.1.1.1'); + if ($namemap) { + my $ifnamesupport=0; #Assume broken ifnamesupport until proven good... (Nortel switch) + foreach (keys %{$namemap}) { + if ($namemap->{$_}) { + $ifnamesupport=1; + last; + } + } + unless ($ifnamesupport) { + $namemap=0; + } + } + unless ($namemap) { #Failback to ifDescr. ifDescr is close, but not perfect on some switches + $namemap = walkoid($session,'.1.3.6.1.2.1.2.2.1.2'); + } unless ($namemap) { -# walkoid errored... return; } #Above is valid without community string indexing, on cisco, we need it on the next one and onward