Ensure docker running before execute the destroy action

Before cleanup containers and hosts, it should be ensure the
docker serivce running but the destroy action missing it,
this patch to fix it

Change-Id: I85ca806c1fd395daf937b585d466e16fbad4e20c
Closes-Bug: #1741852
This commit is contained in:
caoyuan 2018-01-08 16:26:17 +08:00
parent 1b70a37db1
commit 8cb57f54fa
3 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,8 @@
--- ---
- include: copy_tools.yml - include: copy_tools.yml
- include: validate_docker_execute.yml
- include: cleanup_containers.yml - include: cleanup_containers.yml
- include: cleanup_images.yml - include: cleanup_images.yml

View File

@ -0,0 +1,3 @@
---
- name: Ensure the docker service is running
command: /tmp/kolla-cleanup/tools/validate-docker-execute.sh

View File

@ -4,8 +4,6 @@
REAL_PATH=$(python -c "import os,sys;print os.path.realpath('$0')") REAL_PATH=$(python -c "import os,sys;print os.path.realpath('$0')")
cd "$(dirname "$REAL_PATH")/.." cd "$(dirname "$REAL_PATH")/.."
. tools/validate-docker-execute.sh
function process_cmd { function process_cmd {
if [[ -z "$KOLLA_IMAGES" ]]; then if [[ -z "$KOLLA_IMAGES" ]]; then
echo "No images to cleanup, exit now." echo "No images to cleanup, exit now."