diff options
author | Aravinda VK <avishwan@redhat.com> | 2015-12-09 17:09:42 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2016-03-09 04:02:44 -0800 |
commit | d6361f4d52251fe5f2e3af11e3a95fd0cf30a567 (patch) | |
tree | 897060db2cd037d45c7abca87b18346a15ecc733 /tools | |
parent | 2199acfd04b1e70fc6484a89196e7b9e4abb7208 (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: 1315639
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>
(cherry picked from commit 62047c80f541985bf9caa41336f471d95de3ce1c)
Reviewed-on: http://review.gluster.org/13642
Reviewed-by: Vijay Bellur <vbellur@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, |