From 8cb57f54fa055d966d5b03389b0051e780435ee1 Mon Sep 17 00:00:00 2001 From: caoyuan Date: Mon, 8 Jan 2018 16:26:17 +0800 Subject: [PATCH] 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 --- ansible/roles/destroy/tasks/main.yml | 2 ++ ansible/roles/destroy/tasks/validate_docker_execute.yml | 3 +++ tools/cleanup-images | 2 -- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 ansible/roles/destroy/tasks/validate_docker_execute.yml diff --git a/ansible/roles/destroy/tasks/main.yml b/ansible/roles/destroy/tasks/main.yml index 13b59b7fbf..0ef20695d8 100644 --- a/ansible/roles/destroy/tasks/main.yml +++ b/ansible/roles/destroy/tasks/main.yml @@ -1,6 +1,8 @@ --- - include: copy_tools.yml +- include: validate_docker_execute.yml + - include: cleanup_containers.yml - include: cleanup_images.yml diff --git a/ansible/roles/destroy/tasks/validate_docker_execute.yml b/ansible/roles/destroy/tasks/validate_docker_execute.yml new file mode 100644 index 0000000000..2839cefe82 --- /dev/null +++ b/ansible/roles/destroy/tasks/validate_docker_execute.yml @@ -0,0 +1,3 @@ +--- +- name: Ensure the docker service is running + command: /tmp/kolla-cleanup/tools/validate-docker-execute.sh diff --git a/tools/cleanup-images b/tools/cleanup-images index 1a89673173..762b2daf75 100755 --- a/tools/cleanup-images +++ b/tools/cleanup-images @@ -4,8 +4,6 @@ REAL_PATH=$(python -c "import os,sys;print os.path.realpath('$0')") cd "$(dirname "$REAL_PATH")/.." -. tools/validate-docker-execute.sh - function process_cmd { if [[ -z "$KOLLA_IMAGES" ]]; then echo "No images to cleanup, exit now."