summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAravinda VK <avishwan@redhat.com>2015-04-08 17:39:56 +0530
committerVijay Bellur <vbellur@redhat.com>2015-05-03 11:08:48 -0700
commit4c202feab860bc5cc78b2c243b5ace264c4f5929 (patch)
treea67effc04928ea2adccf28db42c368147960f36d /tools
parent42c51dcdf3e99d955b98bab53afee0a3c9a2a7df (diff)
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 <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/10164 Reviewed-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/10497 Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'tools')
-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 96d3d8d..22d4210 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)