Neutron: only do ARP_CMD if IP_BRD is not an empty string

Some third party CI systems leave PUBLIC_INTERFACE as the default,
but do not actually create the device. ip would set errno to 1 when
this happens[1], and that's fine - however arping would exit with errno
set to 2, which triggers the exit_trap and stops stacking.[2]

[1]: http://openstack.fit-tecnologia.org.br:10000/36/295836/6/check/hitachi-hnas-ssc/3362683/logs/devstacklog.txt.gz#_2016-05-12_17_24_40_458

[2]: http://openstack.fit-tecnologia.org.br:10000/36/295836/6/check/hitachi-hnas-ssc/3362683/logs/devstacklog.txt.gz#_2016-05-12_17_24_40_545

Change-Id: Iaf08b475eeec5e179a11a42d35fe532b2a15aa41
This commit is contained in:
Sean M. Collins
2016-05-12 16:14:26 -04:00
parent ab539b441d
commit 6d4843ed96

View File

@@ -625,11 +625,6 @@ function _move_neutron_addresses_route {
IP_BRD=$(ip -f $af a s dev $from_intf scope global primary | grep inet | awk '{ print $2, $3, $4; exit }')
if [[ "$af" == "inet" ]]; then
IP=$(echo $IP_BRD | awk '{ print $1; exit }' | grep -o -E '(.*)/' | cut -d "/" -f1)
ARP_CMD="arping -A -c 3 -w 4.5 -I $to_intf $IP "
fi
if [ "$DEFAULT_ROUTE_GW" != "" ]; then
ADD_DEFAULT_ROUTE="sudo ip -f $af r replace default via $DEFAULT_ROUTE_GW dev $to_intf"
fi
@@ -646,6 +641,10 @@ function _move_neutron_addresses_route {
IP_DEL="sudo ip addr del $IP_BRD dev $from_intf"
IP_ADD="sudo ip addr add $IP_BRD dev $to_intf"
IP_UP="sudo ip link set $to_intf up"
if [[ "$af" == "inet" ]]; then
IP=$(echo $IP_BRD | awk '{ print $1; exit }' | grep -o -E '(.*)/' | cut -d "/" -f1)
ARP_CMD="arping -A -c 3 -w 4.5 -I $to_intf $IP "
fi
fi
# The add/del OVS port calls have to happen either before or