From 4c202feab860bc5cc78b2c243b5ace264c4f5929 Mon Sep 17 00:00:00 2001 From: Aravinda VK Date: Wed, 8 Apr 2015 17:39:56 +0530 Subject: tools/glusterfind: Do not fail to list if Session is invalid If session is invalid, Show the session time as "Session Corrupted" BUG: 1217927 Change-Id: I10f7fb79f6a3a2cabab3f21bce86f2a2f424e8b6 Signed-off-by: Aravinda VK Reviewed-on: http://review.gluster.org/10164 Reviewed-by: Kotresh HR Reviewed-on: http://review.gluster.org/10497 Tested-by: Gluster Build System --- tools/glusterfind/src/main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/glusterfind/src/main.py b/tools/glusterfind/src/main.py index 96d3d8d5f33..22d421035ff 100644 --- a/tools/glusterfind/src/main.py +++ b/tools/glusterfind/src/main.py @@ -474,9 +474,15 @@ def mode_list(session_dir, args): sys.stdout.write("-"*75) sys.stdout.write("\n") for session, volname, last_processed in output: + sess_time = 'Session Corrupted' + if last_processed: + try: + sess_time = human_time(last_processed) + except TypeError: + sess_time = 'Session Corrupted' sys.stdout.write("%s %s %s\n" % (session.ljust(25), volname.ljust(25), - human_time(last_processed).ljust(25))) + sess_time.ljust(25))) if not output and (args.session or args.volume): fail("Invalid Session", logger=logger) -- cgit