summaryrefslogtreecommitdiffstats
path: root/tests/utils/pidof.py
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2018-04-13 09:13:16 -0400
committerKaleb KEITHLEY <kkeithle@redhat.com>2018-05-02 11:28:46 +0000
commit4e7b423d3c3137c3f83b71b36279e1a544154833 (patch)
treee59dc57aa319a5e145161a0e32fba9fc74773e91 /tests/utils/pidof.py
parent9da91172538a2a95fba609c93e199db159fd1938 (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 'tests/utils/pidof.py')
-rwxr-xr-xtests/utils/pidof.py11
1 files changed, 6 insertions, 5 deletions
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)