Merge "Fix ovs-cleanup issue at cleanup scripts"

This commit is contained in:
Jenkins 2017-01-09 14:28:52 +00:00 committed by Gerrit Code Review
commit b8df00bb95
2 changed files with 12 additions and 7 deletions

View File

@ -8,8 +8,9 @@ if [[ $COMPUTE ]] && [[ $QEMU_PIDS ]] && [[ $(ps --no-headers wwwup $QEMU_PIDS |
fi
if [ -n "$1" ]; then
containers_to_kill=($(docker ps | grep -E "$1" | awk '{print $1}'))
volumes_to_remove=($(docker volume ls | grep -E "$1" | awk '{print $1}'))
containers_to_kill=($(docker ps --filter "label=kolla_version" --format "{{.Names}}" -a | grep -E "$1" | awk '{print $1}'))
volumes_to_remove=($(docker inspect -f '{{range .Mounts}} {{printf "%s\n" .Name }}{{end}}' $1 | \
egrep -v '(^\s*$)' | sort | uniq))
else
containers_to_kill=$(docker ps --filter "label=kolla_version" --format "{{.Names}}" -a)
@ -17,6 +18,15 @@ else
egrep -v '(^\s*$)' | sort | uniq)
fi
containers_running=$(docker ps --filter "label=kolla_version" --format "{{.Names}}")
if [[ "${containers_to_kill}" =~ "openvswitch_vswitchd" ]] && [[ "${containers_running}" =~ "neutron_openvswitch_agent" ]]; then
echo "Removing ovs bridge..."
(docker exec -u root neutron_openvswitch_agent neutron-ovs-cleanup \
--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini \
--ovs_all_ports) > /dev/null
fi
echo "Stopping containers..."
(docker stop -t 2 ${containers_to_kill} 2>&1) > /dev/null

View File

@ -27,11 +27,6 @@ ip -o link show | awk -F': ' '/vxlan/{print $2}' | while read -r ifname ; do
ip link delete $ifname type vxlan
done
echo "Removing ovs bridge..."
(docker exec -u root neutron_openvswitch_agent neutron-ovs-cleanup \
--config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugins/ml2/ml2_conf.ini \
--ovs_all_ports) > /dev/null
# Keepalived leaves VIP on the host in case of accidental removal.
# This snippet removes VIPs.
if [[ "$enable_haproxy" == "yes" ]]; then