s3/script/tests: convert print func to be py2/py3 compatible
authorNoel Power <noel.power@suse.com>
Fri, 9 Mar 2018 14:04:29 +0000 (14:04 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 23 Mar 2018 06:28:24 +0000 (07:28 +0100)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source3/script/tests/test_wbinfo_sids2xids_int.py

index 21804452365a8aaa7e49fc8c99fb2030ba488de7..2c8920c44d1034bb776dbc676c7cd66de4c16f94 100755 (executable)
@@ -1,10 +1,11 @@
 #!/usr/bin/env python
 
+from __future__ import print_function
 import sys,os,subprocess
 
 
 if len(sys.argv) != 3:
-    print "Usage: test_wbinfo_sids2xids_int.py wbinfo net"
+    print("Usage: test_wbinfo_sids2xids_int.py wbinfo net")
     sys.exit(1)
 
 wbinfo = sys.argv[1]
@@ -78,7 +79,7 @@ def check_singular(sids, ids, idtype='gid'):
         outid = subprocess.Popen([wbinfo, '--sid-to-%s' % idtype, sid],
                                  stdout=subprocess.PIPE).communicate()[0].strip()
         if outid != ids[i]:
-            print "Expected %s, got %s\n" % (outid, ids[i])
+            print("Expected %s, got %s\n" % (outid, ids[i]))
             flush_cache(sids=sids, uids=uids, gids=gids)
             sys.exit(1)
         i += 1
@@ -94,7 +95,7 @@ def check_multiple(sids, idtypes):
         result = line.split(' ')[2:]
 
         if result[0] != idtypes[i]:
-            print "Expected %s, got %s\n" % (idtypes[i], result[0])
+            print("Expected %s, got %s\n" % (idtypes[i], result[0]))
             flush_cache(sids=sids, uids=uids, gids=gids)
             sys.exit(1)
         i += 1