1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

PEP8: improve formatting around various operators

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Douglas Bagnall 2018-08-22 18:26:48 +12:00 committed by Douglas Bagnall
parent 0632085142
commit aa5db3da2b
5 changed files with 8 additions and 8 deletions

View File

@ -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()

View File

@ -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])

View File

@ -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)

View File

@ -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)

View File

@ -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)