From 7a8b802a863f9e5d7ea17af740a953ef5be18954 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 45dac8450..c12f44e79 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -368,7 +368,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"; @@ -384,6 +385,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 { @@ -393,7 +398,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; @@ -1047,8 +1054,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;