From d6361f4d52251fe5f2e3af11e3a95fd0cf30a567 Mon Sep 17 00:00:00 2001 From: Aravinda VK Date: Wed, 9 Dec 2015 17:09:42 +0530 Subject: tools/glusterfind: Do not fail cleanup script on volume delete If glusterfind dir is not present inside GLUSTERD_WORKDIR, then cleanup script Post Volume delete was failing. This patch safely handles the absence of glusterfind directory in GLUSTERD_WORKDIR BUG: 1315639 Change-Id: I9f7e6035e3dc6079927803df942b0f921218c79a Signed-off-by: Aravinda VK Reviewed-on: http://review.gluster.org/12923 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Kotresh HR (cherry picked from commit 62047c80f541985bf9caa41336f471d95de3ce1c) Reviewed-on: http://review.gluster.org/13642 Reviewed-by: Vijay Bellur --- tools/glusterfind/S57glusterfind-delete-post.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/glusterfind/S57glusterfind-delete-post.py b/tools/glusterfind/S57glusterfind-delete-post.py index 70edb563320..9e7774a9828 100755 --- a/tools/glusterfind/S57glusterfind-delete-post.py +++ b/tools/glusterfind/S57glusterfind-delete-post.py @@ -40,7 +40,12 @@ def main(): # Check all session directories, if any directory found for # the deleted volume, cleanup all the session directories - for session in os.listdir(glusterfind_dir): + try: + ls_glusterfind_dir = os.listdir(glusterfind_dir) + except OSError: + ls_glusterfind_dir = [] + + for session in ls_glusterfind_dir: # Possible session directory volume_session_path = os.path.join(glusterfind_dir, session, -- cgit