diff options
author | Aravinda VK <avishwan@redhat.com> | 2015-12-09 17:09:42 +0530 |
---|---|---|
committer | Aravinda VK <avishwan@redhat.com> | 2016-03-08 01:58:10 -0800 |
commit | 62047c80f541985bf9caa41336f471d95de3ce1c (patch) | |
tree | b0d4e1df1797a41d41780bc08589f3d9c343d275 /tools | |
parent | f44232e6a18a4b79e680ea0b6322269b84fa6813 (diff) |
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: 1289935
Change-Id: I9f7e6035e3dc6079927803df942b0f921218c79a
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: http://review.gluster.org/12923
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/glusterfind/S57glusterfind-delete-post.py | 7 |
1 files changed, 6 insertions, 1 deletions
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, |