diff options
author | wu.chunyang <wuchunyang@yovole.com> | 2022-07-14 22:03:35 +0800 |
---|---|---|
committer | wu.chunyang <wuchunyang@yovole.com> | 2022-07-19 22:33:21 +0800 |
commit | a8d9a82df18c78b5ab244761e2861f6d023d6887 (patch) | |
tree | dd43eaaccd0b45eb2dadb483fa484d8a3e4fafeb | |
parent | 6a4e610bec19c5bac163080b7b7e23b47ee162fd (diff) | |
download | trove-a8d9a82df18c78b5ab244761e2861f6d023d6887.tar.gz |
Add a check before executing ip replace
sometimes, ROUTER_GW_IP or IPV4_ADDRS_SAFE_TO_USE
may not defined in localrc, we add a check before
executing ip replace command.
Change-Id: I48ca40cc2259e21b8a8f0a9fa763746c30f0e8ab
-rw-r--r-- | devstack/plugin.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 01800907..2b34158e 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -538,7 +538,9 @@ function config_trove_network { if [[ "$shared" == "False" ]]; then openstack network set ${PRIVATE_NETWORK_NAME} --share fi - sudo ip route replace ${IPV4_ADDRS_SAFE_TO_USE} via $ROUTER_GW_IP + if [[ -n ${ROUTER_GW_IP} && -n ${IPV4_ADDRS_SAFE_TO_USE} ]]; then + sudo ip route replace ${IPV4_ADDRS_SAFE_TO_USE} via $ROUTER_GW_IP + fi # Make sure we can reach the management port of the service VM, this # configuration is only for testing purpose. In production, it's |