GeezerVison is showing github.com — Merge "Add verification of OVS_PHYSICAL_BRIDGE" · opneC/devstack@7991780
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: lib/neutron-legacy +12-10Lines changed: 12 additions & 10 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -839,18 +839,20 @@ function _move_neutron_addresses_route { |
839 | 839 | # runs that a clean run would need to clean up |
840 | 840 | function cleanup_neutron { |
841 | 841 |
|
842 | | - _move_neutron_addresses_route "$OVS_PHYSICAL_BRIDGE" "$PUBLIC_INTERFACE" False "inet" |
| 842 | + if [[ -n "$OVS_PHYSICAL_BRIDGE" ]]; then |
| 843 | + _move_neutron_addresses_route "$OVS_PHYSICAL_BRIDGE" "$PUBLIC_INTERFACE" False "inet" |
843 | 844 |
|
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 |
| 845 | + if [[ $(ip -f inet6 a s dev "$OVS_PHYSICAL_BRIDGE" | grep -c 'global') != 0 ]]; then |
| 846 | + _move_neutron_addresses_route "$OVS_PHYSICAL_BRIDGE" "$PUBLIC_INTERFACE" False "inet6" |
| 847 | + fi |
847 | 848 |
|
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 |
| 849 | + if is_provider_network && is_ironic_hardware; then |
| 850 | + for IP in $(ip addr show dev $OVS_PHYSICAL_BRIDGE | grep ' inet ' | awk '{print $2}'); do |
| 851 | + sudo ip addr del $IP dev $OVS_PHYSICAL_BRIDGE |
| 852 | + sudo ip addr add $IP dev $PUBLIC_INTERFACE |
| 853 | + done |
| 854 | + sudo route del -net $FIXED_RANGE gw $NETWORK_GATEWAY dev $OVS_PHYSICAL_BRIDGE |
| 855 | + fi |
854 | 856 | fi |
855 | 857 |
|
856 | 858 | if is_neutron_ovs_base_plugin; then |
|