diff options
author | Kaleb S. KEITHLEY <kkeithle@redhat.com> | 2018-04-13 09:13:16 -0400 |
---|---|---|
committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2018-05-02 11:28:46 +0000 |
commit | 4e7b423d3c3137c3f83b71b36279e1a544154833 (patch) | |
tree | e59dc57aa319a5e145161a0e32fba9fc74773e91 /events | |
parent | 9da91172538a2a95fba609c93e199db159fd1938 (diff) |
core/various: python3 compat, prepare for python2 -> python3
see https://review.gluster.org/#/c/19788/
use print fn from __future__
Change-Id: If5075d8d9ca9641058fbc71df8a52aa35804cda4
updates: #411
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'events')
-rw-r--r-- | events/tools/eventsdash.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/events/tools/eventsdash.py b/events/tools/eventsdash.py index dc03a61983f..4346c834ee4 100644 --- a/events/tools/eventsdash.py +++ b/events/tools/eventsdash.py @@ -10,6 +10,7 @@ # cases as published by the Free Software Foundation. # +from __future__ import print_function from argparse import ArgumentParser, RawDescriptionHelpFormatter import logging from datetime import datetime @@ -41,11 +42,11 @@ def listen(): for k, v in data.get("message", {}).items(): message.append("{0}={1}".format(k, v)) - print ("{0:20s} {1:20s} {2:36} {3}".format( + print(("{0:20s} {1:20s} {2:36} {3}".format( human_time(data.get("ts")), data.get("event"), data.get("nodeid"), - " ".join(message))) + " ".join(message)))) return "OK" @@ -58,12 +59,12 @@ def main(): action="store_true") args = parser.parse_args() - print ("{0:20s} {1:20s} {2:36} {3}".format( + print(("{0:20s} {1:20s} {2:36} {3}".format( "TIMESTAMP", "EVENT", "NODE ID", "MESSAGE" - )) - print ("{0:20s} {1:20s} {2:36} {3}".format( + ))) + print(("{0:20s} {1:20s} {2:36} {3}".format( "-"*20, "-"*20, "-"*36, "-"*20 - )) + ))) if args.debug: app.debug = True |