summaryrefslogtreecommitdiffstats
path: root/tools/glusterfind/src/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/glusterfind/src/main.py')
-rw-r--r--tools/glusterfind/src/main.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/glusterfind/src/main.py b/tools/glusterfind/src/main.py
index d9936eebde1..ccd2d2297cb 100644
--- a/tools/glusterfind/src/main.py
+++ b/tools/glusterfind/src/main.py
@@ -179,6 +179,11 @@ def get_nodes(volume):
logger=logger)
tree = etree.fromstring(data)
+ # Test to check if volume has been deleted after session creation
+ count_el = tree.find('volInfo/volumes/count')
+ if int(count_el.text) == 0:
+ fail("Unable to get volume details", logger=logger)
+
nodes = []
volume_el = tree.find('volInfo/volumes/volume')
try:
@@ -506,6 +511,11 @@ def main():
if not os.path.exists(session_dir) and args.mode not in ["create", "list"]:
fail("Invalid session %s" % args.session)
+ vol_dir = os.path.join(session_dir, args.volume)
+ if not os.path.exists(vol_dir) and args.mode not in ["create", "list"]:
+ fail("Session %s not created with volume %s" %
+ (args.session, args.volume))
+
mkdirp(os.path.join(conf.get_opt("log_dir"), args.session, args.volume),
exit_on_err=True)
log_file = os.path.join(conf.get_opt("log_dir"),