From: Noel Power Date: Thu, 1 Nov 2018 12:53:01 +0000 (+0000) Subject: tests/py/rodc_rwdc: Fix py2/py3 .next compat issues X-Git-Tag: tdb-1.3.17~974 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=537a26d6d1d1c04456ec0f0b28f04a7de86af027;p=thirdparty%2Fsamba.git tests/py/rodc_rwdc: Fix py2/py3 .next compat issues Python 3 does not have .next(), which we rely on, change the code slightly so it works in py2/py3 (using builtin next function) Pair-programmed-with: Douglas Bagnall Signed-off-by: Noel Power Reviewed-by: Douglas Bagnall Autobuild-User(master): Douglas Bagnall Autobuild-Date(master): Fri Nov 2 06:56:24 CET 2018 on sn-devel-144 --- diff --git a/source4/dsdb/tests/python/rodc_rwdc.py b/source4/dsdb/tests/python/rodc_rwdc.py index cc715e6e7ad..7a2e3b4e6fa 100644 --- a/source4/dsdb/tests/python/rodc_rwdc.py +++ b/source4/dsdb/tests/python/rodc_rwdc.py @@ -115,7 +115,6 @@ def get_server_ref_from_samdb(samdb): class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase): - counter = itertools.count(1).next def _check_account_initial(self, dn): self.force_replication() @@ -686,7 +685,7 @@ class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase): class RodcRwdcTests(password_lockout_base.BasePasswordTestCase): - counter = itertools.count(1).next + counter = itertools.count(1, 1) def force_replication(self, base=None): if base is None: @@ -982,7 +981,7 @@ class RodcRwdcTests(password_lockout_base.BasePasswordTestCase): self._test_add_modify_delete() def _new_user(self): - username = "u%sX%s" % (self.tag[:12], self.counter()) + username = "u%sX%s" % (self.tag[:12], next(self.counter)) password = 'password#1' dn = 'CN=%s,CN=Users,%s' % (username, self.base_dn) o = {