only remove network states from Nova when n-net is enabled

When n-net is not enabled but q-dhcp is enabled then it's not
necessary to remove the states directory of nova-network.

Change-Id: Ib4b37aa7df2b3cda3048b278ddad24e87e3744c9
This commit is contained in:
Christian Berendt 2014-04-07 13:31:07 +00:00
parent 87c0c263a0
commit 7a7fb49b15

View File

@ -1001,9 +1001,13 @@ if is_service_enabled n-net q-dhcp; then
fi
clean_iptables
rm -rf ${NOVA_STATE_PATH}/networks
sudo mkdir -p ${NOVA_STATE_PATH}/networks
safe_chown -R ${USER} ${NOVA_STATE_PATH}/networks
if is_service_enabled n-net; then
rm -rf ${NOVA_STATE_PATH}/networks
sudo mkdir -p ${NOVA_STATE_PATH}/networks
safe_chown -R ${USER} ${NOVA_STATE_PATH}/networks
fi
# Force IP forwarding on, just in case
sudo sysctl -w net.ipv4.ip_forward=1
fi