From 7ee4d4564c97728dd025060843f8ca89116b15ee Mon Sep 17 00:00:00 2001 From: Moshe Levi Date: Sun, 9 Jul 2017 15:48:24 +0300 Subject: [PATCH] stop ovs that installed from git on unstack Change-Id: I6a30ca3e371787d147785944de61746c3cdd6046 --- devstack/lib/ovs | 9 +++++++++ devstack/plugin.sh | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/devstack/lib/ovs b/devstack/lib/ovs index d23caac913d..9490f4001cd 100644 --- a/devstack/lib/ovs +++ b/devstack/lib/ovs @@ -173,6 +173,15 @@ function start_new_ovs () { sudo /usr/share/openvswitch/scripts/ovs-ctl start } +# stop_new_ovs() - stops ovs +function stop_new_ovs () { + local ovs_ctl='/usr/share/openvswitch/scripts/ovs-ctl' + + if [ -x $ovs_ctl ] ; then + sudo $ovs_ctl stop + fi +} + # remove_ovs_packages() - removes old ovs packages from the system function remove_ovs_packages() { for package in openvswitch openvswitch-switch openvswitch-common; do diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 0d4ce8d01b6..afa1f79c4b1 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -69,4 +69,8 @@ elif [[ "$1" == "unstack" ]]; then if is_service_enabled q-sriov-agt neutron-sriov-agent; then stop_l2_agent_sriov fi + if [[ "$NEUTRON_AGENT" == "openvswitch" ]] && \ + [[ "$Q_BUILD_OVS_FROM_GIT" == "True" ]]; then + stop_new_ovs + fi fi