From 0ac6f5d4e8102ddacef920d52a2b87993db82ce3 Mon Sep 17 00:00:00 2001 From: daniceexi Date: Tue, 10 Dec 2013 07:17:51 -0500 Subject: [PATCH] skip the bmc interface for nics configuration --- xCAT-server/lib/perl/xCAT/Template.pm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index 1ec743c90..c7504e29b 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -367,7 +367,8 @@ sub windows_net_cfg { my $gateway; my $interface_cfg = ''; my ($nicname, $ips) = split(/!/, $_); - unless ($nicname) {next;} + unless ($nicname) { next; } + if ($nicname =~ /^bmc/) { next; } # do nothing for bmc interface if ($ips) { $interface_cfg .= 'falsefalse'; $interface_cfg .= "$nicname"; @@ -383,6 +384,10 @@ sub windows_net_cfg { if ($gw) { $gateway = $gw; } $interface_cfg .= ''.$ip."/$netmask".''; } + if ($num eq 1) { + # no correct IP with correct network is found + next; + } $interface_cfg .= "" } else { @@ -392,7 +397,9 @@ sub windows_net_cfg { } # add the default gateway - $interface_cfg .= '1'.$gateway.'0/0'; + if ($gateway) { + $interface_cfg .= '1'.$gateway.'0/0'; + } $interface_cfg .= ''; $interfaces_cfg .= $interface_cfg; @@ -1028,8 +1035,6 @@ sub enablesshbetweennodes return $result; } -# Get the netmask and gateway for a specific ip -# netmask is the number of bits sub getNM_GW() { my $ip = shift;