python/samba: Py2/Py3 compat change '/' to '//' to ensure int result
authorNoel Power <noel.power@suse.com>
Fri, 27 Apr 2018 07:15:28 +0000 (08:15 +0100)
committerNoel Power <npower@samba.org>
Mon, 30 Apr 2018 16:25:25 +0000 (18:25 +0200)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Mon Apr 30 18:25:25 CEST 2018 on sn-devel-144

python/samba/graph.py
python/samba/netcmd/domain.py
python/samba/upgradehelpers.py

index 6cdd2ef77ed67c020234345b116f5ac6f0fc8cd8..7dfc19015e75ccb5dbb7de6cc0c7a6f74ad52e18 100644 (file)
@@ -19,6 +19,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 from __future__ import print_function
+from __future__ import division
 from samba import colour
 import sys
 
@@ -39,8 +40,8 @@ def reformat_graph_label(s):
             if '-' in p[2:20]:
                 q, p = p.split('-', 1)
             else:
-                n = len(p) / 12
-                b = len(p) / n
+                n = len(p) // 12
+                b = len(p) // n
                 q, p = p[:b], p[b:]
             pieces.append(q + '-')
         if p:
index d2dd06a3d4825c16b5e65f457b39110bf2e4b7ad..1e242dea62e4e4d457bf0f6aa6912cb9614f3a7f 100644 (file)
@@ -23,6 +23,7 @@
 #
 
 from __future__ import print_function
+from __future__ import division
 import samba.getopt as options
 import ldb
 import string
@@ -2331,7 +2332,7 @@ class cmd_domain_trust_create(DomainTrustCommand):
             # 512 bytes and a 2 bytes confounder is required.
             #
             def random_trust_secret(length):
-                pw = samba.generate_random_machine_password(length/2, length/2)
+                pw = samba.generate_random_machine_password(length//2, length//2)
                 return string_to_byte_array(pw.encode('utf-16-le'))
 
             if local_trust_info.trust_direction & lsa.LSA_TRUST_DIRECTION_INBOUND:
index e219602e0c789d0fdc444a78aa2bc43c8ee2ebcc..d4f6944523485afff81ffda437217b419d36c342 100644 (file)
@@ -20,6 +20,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 from __future__ import print_function
+from __future__ import division
 """Helpers used for upgrading between different database formats."""
 
 import os
@@ -725,7 +726,7 @@ def findprovisionrange(samdb, basedn):
 
         for o in obj.array:
             # like a timestamp but with the resolution of 1 minute
-            minutestamp =_glue.nttime2unix(o.originating_change_time)/60
+            minutestamp =_glue.nttime2unix(o.originating_change_time) // 60
             hash_ts = hash_id.get(str(o.originating_invocation_id))
 
             if hash_ts is None: