From a3a8a4fda4a1e8441d259b32e776e490c38af1f4 Mon Sep 17 00:00:00 2001 From: Kuo-tung Kao Date: Tue, 6 Oct 2015 11:07:43 +0800 Subject: [PATCH] put conatiner name to array in cleanup-containers The brace in string variable will not be expanded in some case. Put conatiner name into array. Change-Id: I2fb16e7352bd579f207efce0fb9b2565a1e7236d Closes-Bug: #1502467 (cherry picked from commit 1e86af763ba514843326885a8b172f6e548f8be4) --- tools/cleanup-containers | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/cleanup-containers b/tools/cleanup-containers index 4a539d4c8e..4e5cea8e7e 100755 --- a/tools/cleanup-containers +++ b/tools/cleanup-containers @@ -6,7 +6,7 @@ if [[ $(pgrep qemu) ]]; then exit 1 fi -containers_to_kill=" +containers_to_kill=( glance_{api,registry,data} \ haproxy \ heat_{api{,_cfn},engine} \ @@ -22,12 +22,13 @@ containers_to_kill=" openvswitch_{vswitchd,db} \ rabbitmq{,_data} \ rsyslog \ - swift_{account_{auditor,reaper,replicator,server},container_{auditor,expirer,replicator,server,updater},proxy_server,rsyncd}" + swift_{account_{auditor,reaper,replicator,server},container_{auditor,expirer,replicator,server,updater},proxy_server,rsyncd} +) echo "Stopping containers..." -(docker stop -t 2 ${containers_to_kill} 2>&1) > /dev/null +(docker stop -t 2 ${containers_to_kill[@]} 2>&1) > /dev/null echo "Removing containers..." -(docker rm -v -f ${containers_to_kill} 2>&1) > /dev/null +(docker rm -v -f ${containers_to_kill[@]} 2>&1) > /dev/null echo "All cleaned up!"