Merge "Conditionally restore default route in setup_ipv6" into stable/queens

This commit is contained in:
Zuul 2020-05-07 12:10:26 +00:00 committed by Gerrit Code Review
commit 4007c7020c
3 changed files with 15 additions and 5 deletions

View File

@ -189,6 +189,7 @@ if [[ "$MANILA_SETUP_IPV6" == True ]]; then
# regular Neutron DevStack configuration. # regular Neutron DevStack configuration.
echo "NEUTRON_CREATE_INITIAL_NETWORKS=False" >> $localconf echo "NEUTRON_CREATE_INITIAL_NETWORKS=False" >> $localconf
echo "IP_VERSION=4+6" >> $localconf echo "IP_VERSION=4+6" >> $localconf
echo "MANILA_RESTORE_IPV6_DEFAULT_ROUTE=False" >> $localconf
fi fi
if [[ "$DRIVER" == "generic"* ]]; then if [[ "$DRIVER" == "generic"* ]]; then

View File

@ -955,8 +955,12 @@ function install_libraries {
function setup_ipv6 { function setup_ipv6 {
# save IPv6 default route to add back later after enabling forwarding # This will fail with multiple default routes and is not needed in CI
local default_route=$(ip -6 route | grep default | cut -d ' ' -f1,2,3,4,5) # but may be useful when developing with devstack locally
if [ $(trueorfalse False MANILA_RESTORE_IPV6_DEFAULT_ROUTE) == True ]; then
# save IPv6 default route to add back later after enabling forwarding
local default_route=$(ip -6 route | grep default | cut -d ' ' -f1,2,3,4,5)
fi
# make sure those system values are set # make sure those system values are set
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0 sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0
@ -1055,9 +1059,13 @@ function setup_ipv6 {
sudo systemctl restart bgpd sudo systemctl restart bgpd
fi fi
# add default IPv6 route back # This will fail with mutltiple default routes and is not needed in CI
if ! [[ -z $default_route ]]; then # but may be useful when developing with devstack locally
sudo ip -6 route add $default_route if [ $(trueorfalse False MANILA_RESTORE_IPV6_DEFAULT_ROUTE) == True ]; then
# add default IPv6 route back
if ! [[ -z $default_route ]]; then
sudo ip -6 route add $default_route
fi
fi fi
} }

View File

@ -201,6 +201,7 @@ MANILA_DATA_COPY_CHECK_HASH=${MANILA_DATA_COPY_CHECK_HASH:=True}
# Manila IPv6 Setup flag # Manila IPv6 Setup flag
MANILA_SETUP_IPV6=${MANILA_SETUP_IPV6:=False} MANILA_SETUP_IPV6=${MANILA_SETUP_IPV6:=False}
MANILA_RESTORE_IPV6_DEFAULT_ROUTE=${MANILA_RESTORE_IPV6_DEFAULT_ROUTE:=True}
# Enable manila services # Enable manila services
# ---------------------- # ----------------------