aboutsummaryrefslogtreecommitdiff
path: root/tools/cleanup-containers
diff options
context:
space:
mode:
authorcaoyuan <cao.yuan@99cloud.net>2017-03-20 12:19:17 +0800
committercaoyuan <cao.yuan@99cloud.net>2017-03-20 04:40:33 +0000
commita565925b0f286a6fe82b4698b2a2196405e3f8e5 (patch)
tree75720e391f87998bed214b4d02c4cf137eb46956 /tools/cleanup-containers
parent469eb14886110cc50dc9be635d3ad4f2405c25af (diff)
downloadkolla-ansible-a565925b0f286a6fe82b4698b2a2196405e3f8e5.tar.gz
kolla-ansible-a565925b0f286a6fe82b4698b2a2196405e3f8e5.zip
Fix the remove mariadb volume failed
- when run tools/cleanup-containers mariadb, the mariadb volume remove failed, because the "volumes_to_remove" can't catch the mariadb volume, this patch to fix it. - remove the unnecessary "()" more test infomation, see http://paste.openstack.org/show/603359/ Closes-Bug: #1674207 Change-Id: I82f5922fcc84d222f74d2551a2c697bf78136a2d
Diffstat (limited to 'tools/cleanup-containers')
-rwxr-xr-xtools/cleanup-containers6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/cleanup-containers b/tools/cleanup-containers
index b48c2fc84..a6fee80ea 100755
--- a/tools/cleanup-containers
+++ b/tools/cleanup-containers
@@ -11,9 +11,9 @@ if [[ "${containers_running}" =~ "nova_libvirt" ]] && [[ $QEMU_PIDS ]] && [[ $(p
fi
if [ -n "$1" ]; then
- 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))
+ 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}}' ${containers_to_kill} | \
+ egrep -v '(^\s*$)' | sort | uniq)
else
containers_to_kill=$(docker ps --filter "label=kolla_version" --format "{{.Names}}" -a)