diff options
| author | caoyuan <cao.yuan@99cloud.net> | 2017-03-20 12:19:17 +0800 |
|---|---|---|
| committer | caoyuan <cao.yuan@99cloud.net> | 2017-03-20 04:40:33 +0000 |
| commit | a565925b0f286a6fe82b4698b2a2196405e3f8e5 (patch) | |
| tree | 75720e391f87998bed214b4d02c4cf137eb46956 | |
| parent | 469eb14886110cc50dc9be635d3ad4f2405c25af (diff) | |
| download | kolla-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
| -rwxr-xr-x | tools/cleanup-containers | 6 |
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) |
