summaryrefslogtreecommitdiffstats
path: root/tools/glusterfind/src
diff options
context:
space:
mode:
authorAravinda VK <avishwan@redhat.com>2015-04-08 17:39:56 +0530
committerVijay Bellur <vbellur@redhat.com>2015-04-23 06:56:06 -0700
commit0fc310accb6bf86e42e09e0876b51b8860075fda (patch)
tree53e550f51fe59e776200ac2ab482946995369b0e /tools/glusterfind/src
parent838317e199c6cc11ff5e7094552537f03a8f6313 (diff)
tools/glusterfind: Do not fail to list if Session is invalid
If session is invalid, Show the session time as "Session Corrupted" BUG: 1209843 Change-Id: I10f7fb79f6a3a2cabab3f21bce86f2a2f424e8b6 Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/10164 Reviewed-by: Kotresh HR <khiremat@redhat.com> Tested-by: NetBSD Build System
Diffstat (limited to 'tools/glusterfind/src')
-rw-r--r--tools/glusterfind/src/main.py8
1 files changed, 7 insertions, 1 deletions
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)