python: fix the build with python3.
authorGünther Deschner <gd@samba.org>
Mon, 15 Jan 2018 20:56:22 +0000 (21:56 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 16 Jan 2018 15:38:23 +0000 (16:38 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13221

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
python/samba/emulate/traffic_packets.py
python/samba/forest_update.py
python/samba/tests/blackbox/traffic_summary.py
python/samba/tests/samba_tool/visualize.py

index 1df21f99a353071eadccee5c0c8b26f3689783f2..185d1d57476a179fbf3154be849394bf17865e8d 100644 (file)
@@ -84,7 +84,7 @@ name_formats = [
 
 
 def warning(message):
-    print "\033[37;41;1m" "Warning: %s" "\033[00m" % (message)
+    print("\033[37;41;1m" "Warning: %s" "\033[00m" % (message))
 
 ###############################################################################
 #
index 9f6ddf6aac2592b138f399321c99b78cc3842901..ba6f859a9438909b325db31a37eebd14bffff595 100644 (file)
@@ -300,8 +300,8 @@ objectClass: container
                                                "SCHEMA_DN":
                                                str(self.schema_dn)})
         if self.verbose:
-            print "UPDATE (LDIF) ------ OPERATION %d" % op
-            print sub_ldif
+            print("UPDATE (LDIF) ------ OPERATION %d" % op)
+            print(sub_ldif)
 
         self.samdb.modify_ldif(sub_ldif)
         if self.add_update_container:
index b2bbc2cb0754c86aac725f568b8c2df7284a6d52..99fe6b84e946882dedc0584c0991c59eb2a471c6 100644 (file)
@@ -59,7 +59,7 @@ class TrafficSummaryTests(BlackboxTestCase):
 
         with temp_file(self.tempdir) as output:
             command  = "%s %s >%s" % (SCRIPT, INPUT, output)
-            print command
+            print(command)
             self.check_run(command)
             expected = open(EXPECTED_FN).readlines()
             actual = open(output).readlines()
index 292d4961f45a57fa5fc2660587f280c42a3acbcf..c00c6ea63b08943daf6a44592a537b118643ce3b 100644 (file)
@@ -284,7 +284,7 @@ class SambaToolVisualizeLdif(SambaToolCmdTest):
                                         self.tempdir,
                                         self.lp, tag='disconnected')
         dburl = 'tdb://' + dbfile
-        print dbfile
+        print(dbfile)
         result, output, err = self.runsubcmd("visualize", "ntdsconn",
                                              '-H', dburl,
                                              '--color=no', '-S')
@@ -314,7 +314,7 @@ class SambaToolVisualizeLdif(SambaToolCmdTest):
                                           '-o', '-')
         self.assertCmdSuccess(result, dot, err)
         self.remove_files(dbfile)
-        print dot
+        print(dot)
 
         self.assertStringsEqual(EXPECTED_DOT_NTDSCONN_DISCONNECTED, dot,
                                 strip=True)
@@ -338,7 +338,7 @@ class SambaToolVisualizeLdif(SambaToolCmdTest):
         self.assertStringsEqual(EXPECTED_DOT_NTDSCONN_DISCONNECTED, dot)
 
         self.remove_files(dbfile, dot_file)
-        print dot
+        print(dot)
 
 EXPECTED_DOT_MULTISITE_NO_KEY = r"""/* generated by samba */
 digraph A_samba_tool_production {