kcc/kcc_utils: fix divide for py3
authorJoe Guo <joeg@catalyst.net.nz>
Tue, 10 Apr 2018 00:58:52 +0000 (12:58 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Fri, 13 Apr 2018 05:27:13 +0000 (07:27 +0200)
`/` will return float other than int in py3.
Use `//` to keep consistent with py2.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/kcc/kcc_utils.py

index a4870a3e7c83543dd2a0ac51ee994e9728f21f08..6e15c0b1e31123d279163db2c4f463114b67b155 100644 (file)
@@ -1669,7 +1669,7 @@ class Site(object):
         #
         # Note: We don't want to divide by zero here so they must
         #       have meant "f" instead of "o!interSiteTopologyFailover"
-        k_idx = (i_idx + ((self.nt_now - t_time) / f)) % len(D_sort)
+        k_idx = (i_idx + ((self.nt_now - t_time) // f)) % len(D_sort)
 
         # The local writable DC acts as an ISTG for its site if and
         # only if dk is the nTDSDSA object for the local DC. If the