From ef2d4ada6b0c31cfedba7ed86199cdeeac404bc5 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 17 Jun 2008 23:25:47 +0000 Subject: [PATCH] -Handle AMM BPET 42D firmware representation of JS-22 mac addresses for discovery git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1682 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/blade.pm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/blade.pm b/xCAT-server/lib/xcat/plugins/blade.pm index 12c6ede01..8a898cfee 100644 --- a/xCAT-server/lib/xcat/plugins/blade.pm +++ b/xCAT-server/lib/xcat/plugins/blade.pm @@ -175,7 +175,21 @@ sub fillresps { my $mac = $response->{node}->[0]->{data}->[0]->{contents}->[0]; my $node = $response->{node}->[0]->{name}->[0]; $mac = uc($mac); #Make sure it is uppercase, the MM people seem to change their mind on this.. - $macmap{$mac} = $node; + if ($mac =~ /->/) { #The new and 'improved' syntax for pBlades + $mac =~ /(\w+):(\w+):(\w+):(\w+):(\w+):(\w+)\s*->\s*(\w+):(\w+):(\w+):(\w+):(\w+):(\w+)/; + my $fmac=hex($3.$4.$5.$6); + my $lmac=hex($9.$10.$11.$12); + my $pfx = $1.$2; + foreach ($fmac..$lmac) { + my $key = $pfx.sprintf("%08x",$_); + $key =~ s/(\w{2})/$1:/g; + chop($key); + $key = uc($key); + $macmap{$key} = $node; + } + } else { + $macmap{$mac} = $node; + } #$macmap{$response->{node}->[0]->{data}->{contents}->[0]}=$response->{node}->[0]->{name}; } sub isallchassis {