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 /xlators/features/changelog | |
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 'xlators/features/changelog')
-rw-r--r-- | xlators/features/changelog/lib/examples/python/changes.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/xlators/features/changelog/lib/examples/python/changes.py b/xlators/features/changelog/lib/examples/python/changes.py index c0341b52ca3..077c1108cce 100644 --- a/xlators/features/changelog/lib/examples/python/changes.py +++ b/xlators/features/changelog/lib/examples/python/changes.py @@ -1,5 +1,6 @@ #!/usr/bin/python2 +from __future__ import print_function import os import sys import time @@ -16,18 +17,18 @@ def get_changes(brick, scratch_dir, log_file, log_level, interval): cl.cl_scan() change_list = cl.cl_getchanges() if change_list: - print change_list + print(change_list) for change in change_list: - print('done with %s' % (change)) + print(('done with %s' % (change))) cl.cl_done(change) time.sleep(interval) except OSError: ex = sys.exc_info()[1] - print ex + print(ex) if __name__ == '__main__': if len(sys.argv) != 6: - print("usage: %s <brick> <scratch-dir> <log-file> <fetch-interval>" - % (sys.argv[0])) + print(("usage: %s <brick> <scratch-dir> <log-file> <fetch-interval>" + % (sys.argv[0]))) sys.exit(1) get_changes(sys.argv[1], sys.argv[2], sys.argv[3], 9, int(sys.argv[4])) |