From 4bb722b4404eeb48e30e8730e31fc3447d14b8b2 Mon Sep 17 00:00:00 2001 From: jeckxie Date: Fri, 14 Apr 2017 10:16:45 +0800 Subject: [PATCH] Remove /etc/fstab Swift references during cleanup-host During cleanup-host, we need remove swift references from fstab. Change-Id: I18e9a84b0664eb834cf397bcf6d2406abcab47a7 Closes-Bug: #1689285 --- ansible/roles/destroy/tasks/cleanup_host.yml | 1 + tools/cleanup-host | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/ansible/roles/destroy/tasks/cleanup_host.yml b/ansible/roles/destroy/tasks/cleanup_host.yml index 228fb70bbd..38ca03f78a 100644 --- a/ansible/roles/destroy/tasks/cleanup_host.yml +++ b/ansible/roles/destroy/tasks/cleanup_host.yml @@ -2,6 +2,7 @@ - name: Destroying Kolla host configuration command: > env enable_haproxy={{ enable_haproxy }} + enable_swift={{ enable_swift }} kolla_internal_vip_address={{ kolla_internal_vip_address }} kolla_external_vip_address={{ kolla_external_vip_address }} /tmp/kolla-cleanup/tools/cleanup-host diff --git a/tools/cleanup-host b/tools/cleanup-host index 9800b70833..cc2aa322ab 100755 --- a/tools/cleanup-host +++ b/tools/cleanup-host @@ -45,6 +45,12 @@ done echo "Removing ceph references from fstab..." sudo sed -i '/\/var\/lib\/ceph\/osd\//d' /etc/fstab +if [[ "$enable_swift" == "yes" ]]; then + echo "Removing swift references from fstab..." + cat /etc/fstab | grep "/srv/node/d*" | xargs umount + sed -i '/\/srv\/node\//d' /etc/fstab +fi + echo "Getting folders name..." FOLDER_PATH="/etc/kolla/" for dir in $FOLDER_PATH*; do