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 1e86af763b)
This commit is contained in:
Kuo-tung Kao 2015-10-06 11:07:43 +08:00 committed by Martin André
parent c358586cce
commit a3a8a4fda4
1 changed files with 5 additions and 4 deletions

View File

@ -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!"