OVS_PHYSICAL_BRIDGE is not always set, like when you don't need specify the
bridge mapping, and also it has no default value. So we need to add
verification of OVS_PHYSICAL_BRIDGE in cleanup_neutron function where we refer
to it.
Change-Id: I69d113a7f3f7e67b09cb72fa0b0d3bba188e783a
Close-Bug: #1474634
| ... | ... |
@@ -838,18 +838,20 @@ function _move_neutron_addresses_route {
|
| 838 | 838 |
# runs that a clean run would need to clean up |
| 839 | 839 |
function cleanup_neutron {
|
| 840 | 840 |
|
| 841 |
- _move_neutron_addresses_route "$OVS_PHYSICAL_BRIDGE" "$PUBLIC_INTERFACE" False "inet" |
|
| 841 |
+ if [[ -n "$OVS_PHYSICAL_BRIDGE" ]]; then |
|
| 842 |
+ _move_neutron_addresses_route "$OVS_PHYSICAL_BRIDGE" "$PUBLIC_INTERFACE" False "inet" |
|
| 842 | 843 |
|
| 843 |
- if [[ $(ip -f inet6 a s dev "$OVS_PHYSICAL_BRIDGE" | grep -c 'global') != 0 ]]; then |
|
| 844 |
- _move_neutron_addresses_route "$OVS_PHYSICAL_BRIDGE" "$PUBLIC_INTERFACE" False "inet6" |
|
| 845 |
- fi |
|
| 844 |
+ if [[ $(ip -f inet6 a s dev "$OVS_PHYSICAL_BRIDGE" | grep -c 'global') != 0 ]]; then |
|
| 845 |
+ _move_neutron_addresses_route "$OVS_PHYSICAL_BRIDGE" "$PUBLIC_INTERFACE" False "inet6" |
|
| 846 |
+ fi |
|
| 846 | 847 |
|
| 847 |
- if is_provider_network && is_ironic_hardware; then |
|
| 848 |
- for IP in $(ip addr show dev $OVS_PHYSICAL_BRIDGE | grep ' inet ' | awk '{print $2}'); do
|
|
| 849 |
- sudo ip addr del $IP dev $OVS_PHYSICAL_BRIDGE |
|
| 850 |
- sudo ip addr add $IP dev $PUBLIC_INTERFACE |
|
| 851 |
- done |
|
| 852 |
- sudo route del -net $FIXED_RANGE gw $NETWORK_GATEWAY dev $OVS_PHYSICAL_BRIDGE |
|
| 848 |
+ if is_provider_network && is_ironic_hardware; then |
|
| 849 |
+ for IP in $(ip addr show dev $OVS_PHYSICAL_BRIDGE | grep ' inet ' | awk '{print $2}'); do
|
|
| 850 |
+ sudo ip addr del $IP dev $OVS_PHYSICAL_BRIDGE |
|
| 851 |
+ sudo ip addr add $IP dev $PUBLIC_INTERFACE |
|
| 852 |
+ done |
|
| 853 |
+ sudo route del -net $FIXED_RANGE gw $NETWORK_GATEWAY dev $OVS_PHYSICAL_BRIDGE |
|
| 854 |
+ fi |
|
| 853 | 855 |
fi |
| 854 | 856 |
|
| 855 | 857 |
if is_neutron_ovs_base_plugin; then |