From 3f41092a5b000ffd18dea3e55a769736d997c44f Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 13 Oct 2009 21:15:46 +0000 Subject: [PATCH] -Implement getmacs to be able to describe common cases of JS blade extra interfaces. Beyond this level of complexity, discovery is needed git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4379 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/blade.pm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/blade.pm b/xCAT-server/lib/xcat/plugins/blade.pm index 0335d2780..4f17e8b93 100644 --- a/xCAT-server/lib/xcat/plugins/blade.pm +++ b/xCAT-server/lib/xcat/plugins/blade.pm @@ -1352,6 +1352,23 @@ sub rscan_stanza { sub getmacs { (my $code,my @macs)=inv('mac'); + foreach (@macs) { + if (/(.*) ->/) { #Convert JS style mac ranges to pretend to be simple + #this is not a guarantee of how the macs work, but + #this is as complex as this function can reasonably accomodate + #if you need more complexity, the auto-discovery process + #can actually cope + my $basemac = $1; + $basemac =~ s/mac address \d: //i; + $basemac =~ s/://g; + my $macnum = hex($basemac); + $macnum += 1; + my $newmac = sprintf("%012X",$macnum); + $newmac =~ s/(..)(..)(..)(..)(..)(..)/$1:$2:$3:$4:$5:$6/; + my $newidx = scalar(@macs)+1; + push @macs,"MAC Address $newidx: ".$newmac; + } + } my $midx=0; my @midxary; my $nrtab = xCAT::Table->new('noderes');