From ac2618ae8f6c94ce71cd88e7f665176d2bc6a35f Mon Sep 17 00:00:00 2001
From: Eric Harney <eharney@redhat.com>
Date: Fri, 12 Oct 2018 12:00:10 -0400
Subject: [PATCH] Be cleaner when unstacking a failed deployment

This prevents an error from "find" due to the
dir not existing.

Change-Id: I679f42ee88f1e8ae6d656195f5377a8b06f1cee9
---
 devstack/plugin.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/devstack/plugin.sh b/devstack/plugin.sh
index cc21c28..980047e 100644
--- a/devstack/plugin.sh
+++ b/devstack/plugin.sh
@@ -109,8 +109,10 @@ fi
 
 if [[ "$1" == "unstack" ]]; then
     # Unmount any NFS shares mounted by Cinder
-    find ${DATA_DIR}/cinder/mnt -mindepth 1 -maxdepth 1 -type d \
-        | sudo xargs umount -l
+    if [[ -d ${DATA_DIR}/cinder/mnt ]]; then
+        find ${DATA_DIR}/cinder/mnt -mindepth 1 -maxdepth 1 -type d \
+            | sudo xargs umount -l
+    fi
 
     sudo rm -f ${STACK_NFS_CONF}