diff --git a/python/samba/tests/dcerpc/raw_testcase.py b/python/samba/tests/dcerpc/raw_testcase.py index 1ab22f3c2e8..25faddb9a2d 100644 --- a/python/samba/tests/dcerpc/raw_testcase.py +++ b/python/samba/tests/dcerpc/raw_testcase.py @@ -215,7 +215,7 @@ class RawDCERPCTest(TestCase): auth_blob=to_server) req = self.generate_alter(call_id=call_id, ctx_list=ctx_list, - assoc_group_id=0xffffffff -assoc_group_id, + assoc_group_id=0xffffffff - assoc_group_id, auth_info=auth_info) self.send_pdu(req) rep = self.recv_pdu() diff --git a/python/samba/upgradehelpers.py b/python/samba/upgradehelpers.py index 3f376072afc..804d820c886 100644 --- a/python/samba/upgradehelpers.py +++ b/python/samba/upgradehelpers.py @@ -282,8 +282,8 @@ def dn_sort(x, y): tab1 = p.split(str(x)) tab2 = p.split(str(y)) minimum = min(len(tab1), len(tab2)) - len1 = len(tab1) -1 - len2 = len(tab2) -1 + len1 = len(tab1) - 1 + len2 = len(tab2) - 1 # Note: python range go up to upper limit but do not include it for i in range(0, minimum): ret = cmp_fn(tab1[len1 - i], tab2[len2 - i]) diff --git a/source4/torture/drs/python/fsmo.py b/source4/torture/drs/python/fsmo.py index b20e850227a..ae8fc9f7020 100644 --- a/source4/torture/drs/python/fsmo.py +++ b/source4/torture/drs/python/fsmo.py @@ -107,7 +107,7 @@ class DrsFsmoTestCase(drs_base.DrsBaseTestCase): role_dn=role_dn, master=self.dsServiceName_dc2) self.assertTrue(res, - "Transferring %s role to %s has failed, master is: %s!" %(role, self.dsServiceName_dc2, master)) + "Transferring %s role to %s has failed, master is: %s!" % (role, self.dsServiceName_dc2, master)) # dc1 gets back the role from dc2 print("Testing for %s role transfer from %s to %s" % (role, self.dnsname_dc2, self.dnsname_dc1)) @@ -117,7 +117,7 @@ class DrsFsmoTestCase(drs_base.DrsBaseTestCase): role_dn=role_dn, master=self.dsServiceName_dc1) self.assertTrue(res, - "Transferring %s role to %s has failed, master is: %s!" %(role, self.dsServiceName_dc1, master)) + "Transferring %s role to %s has failed, master is: %s!" % (role, self.dsServiceName_dc1, master)) # dc1 keeps the role print("Testing for no-op %s role transfer from %s to %s" % (role, self.dnsname_dc2, self.dnsname_dc1)) @@ -127,7 +127,7 @@ class DrsFsmoTestCase(drs_base.DrsBaseTestCase): role_dn=role_dn, master=self.dsServiceName_dc1) self.assertTrue(res, - "Transferring %s role to %s has failed, master is: %s!" %(role, self.dsServiceName_dc1, master)) + "Transferring %s role to %s has failed, master is: %s!" % (role, self.dsServiceName_dc1, master)) def test_SchemaMasterTransfer(self): self._role_transfer(role="schema", role_dn=self.schema_dn) diff --git a/source4/torture/drs/python/getnc_exop.py b/source4/torture/drs/python/getnc_exop.py index 088db2c3217..2084db42eab 100644 --- a/source4/torture/drs/python/getnc_exop.py +++ b/source4/torture/drs/python/getnc_exop.py @@ -123,7 +123,7 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase): # determine the owner dc res = self.ldb_dc1.search(fsmo_obj_dn, scope=SCOPE_BASE, attrs=["fSMORoleOwner"]) - assert len(res) == 1, "Only one fSMORoleOwner value expected for %s!" %fsmo_obj_dn + assert len(res) == 1, "Only one fSMORoleOwner value expected for %s!" % fsmo_obj_dn fsmo_owner = res[0]["fSMORoleOwner"][0] if fsmo_owner == self.info_dc1["dsServiceName"][0]: return (fsmo_info_1, fsmo_info_2) diff --git a/source4/torture/drs/python/ridalloc_exop.py b/source4/torture/drs/python/ridalloc_exop.py index 82aea1108b9..b6ab004e95c 100644 --- a/source4/torture/drs/python/ridalloc_exop.py +++ b/source4/torture/drs/python/ridalloc_exop.py @@ -86,7 +86,7 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase): # determine the owner dc res = self.ldb_dc1.search(fsmo_obj_dn, scope=SCOPE_BASE, attrs=["fSMORoleOwner"]) - assert len(res) == 1, "Only one fSMORoleOwner value expected for %s!" %fsmo_obj_dn + assert len(res) == 1, "Only one fSMORoleOwner value expected for %s!" % fsmo_obj_dn fsmo_owner = res[0]["fSMORoleOwner"][0] if fsmo_owner == self.info_dc1["dsServiceName"][0]: return (fsmo_info_1, fsmo_info_2)