From 4e7b423d3c3137c3f83b71b36279e1a544154833 Mon Sep 17 00:00:00 2001 From: "Kaleb S. KEITHLEY" Date: Fri, 13 Apr 2018 09:13:16 -0400 Subject: 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 --- tests/utils/pidof.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tests/utils/pidof.py') diff --git a/tests/utils/pidof.py b/tests/utils/pidof.py index 01f2f0ad5bd..9f4a6a48a39 100755 --- a/tests/utils/pidof.py +++ b/tests/utils/pidof.py @@ -1,5 +1,6 @@ #!/usr/bin/python2 +from __future__ import print_function import sys try: @@ -21,14 +22,14 @@ def pidof(processname): continue if "gluster" in processname: if processname == "glusterd" and pmap_find(p, "glusterd"): - print (p.pid) + print((p.pid)) if processname == "glusterfs" and pmap_find(p, "client"): - print (p.pid) + print((p.pid)) if processname == "glusterfsd" and pmap_find(p, "posix-acl"): - print (p.pid) + print((p.pid)) continue if processname.strip() == p.name(): - print (p.pid) + print((p.pid)) def main(argv): if len(argv) < 2: @@ -37,7 +38,7 @@ def main(argv): try: pidof(argv[1]) except Exception as err: - print err + print(err) sys.stderr.write("Please be root - %s\n" % err); sys.exit(1) -- cgit