From c8053583bdccf90c37a2ce045cc1f29b752a241c Mon Sep 17 00:00:00 2001 From: jjhua Date: Mon, 18 Nov 2013 15:37:15 -0500 Subject: [PATCH] fixed bug 3898 --- xCAT-OpenStack/postscripts/configbr-ex | 28 ++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/xCAT-OpenStack/postscripts/configbr-ex b/xCAT-OpenStack/postscripts/configbr-ex index 2ea97dce6..97dea5380 100755 --- a/xCAT-OpenStack/postscripts/configbr-ex +++ b/xCAT-OpenStack/postscripts/configbr-ex @@ -1,4 +1,4 @@ -#!/bin/sh -vx +#!/bin/sh bridge_name="br-ex" @@ -19,7 +19,7 @@ str_value=$(hashget hash_defined_nics $pubinterface) old_ifs=$IFS IFS=$',' array_temp=($str_value) -FS=$old_ifs +IFS=$old_ifs if [ -n "${array_temp[1]}" ];then str_nic_type=`echo ${array_temp[1]} | tr "[A-Z]" "[a-z]"` @@ -35,7 +35,27 @@ else fi -configeth $bridge_name ${array_temp[0]} ${array_temp[2]} - +str_network=$(checknetwork ${array_temp[0]}) +if [ -z "$str_network" ];then + logger -t xcat -p local4.info "configbr-ex: could not find the network for $bridge_name which is based on $pubinterface. Please check the networks and nics tables." + echo "configbr-ex: could not find the network for $bridge_name which is based on $pubinterface. Please check the networks and nics tables." + exit -1 +fi + +#configeth $bridge_name ${array_temp[0]} ${array_temp[2]} +configeth $bridge_name ${array_temp[0]} $str_network +if [ $? -ne 0 ];then + logger -t xcat -p local4.info "configbr-ex failed to configure $bridge_name : configeth $bridge_name ${array_temp[0]} $str_network" + echo "confignics: configbr-ex failed to configure $bridge_name : configeth $bridge_name ${array_temp[0]} $str_network" + exit -1 +fi + +. ./configgw $bridge_name +if [ $? -ne 0 ];then + logger -t xcat -p local4.info "configgw failed to configure gateway for $bridge_name." + echo "configgw failed to configure gateway for $bridge_name." + exit -1 +fi +exit 0