From bbaa739bbda4685fa5e38ea0d939496398e11ebf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jelmer=20Vernoo=C4=B3?= Date: Mon, 2 Jun 2014 01:33:43 +0200 Subject: [PATCH] Remove remaining instance of pep8 E211 (too many spaces before operator). Signed-Off-By: Jelmer Vernooij Reviewed-by: Andrew Bartlett Change-Id: I9af3bf582bba8fc1094addb12cd0a5ce04406b5b --- python/samba/drs_utils.py | 28 ++++++++++++++-------------- python/samba/provision/backend.py | 4 ++-- python/samba/schema.py | 4 ++-- python/samba/tests/samba3.py | 2 +- selftest/selftesthelpers.py | 1 - source4/scripting/bin/samba_kcc | 4 ++-- 6 files changed, 21 insertions(+), 22 deletions(-) diff --git a/python/samba/drs_utils.py b/python/samba/drs_utils.py index 49837492b7d..38accdd6ab0 100644 --- a/python/samba/drs_utils.py +++ b/python/samba/drs_utils.py @@ -203,24 +203,24 @@ class drs_Replicate(object): # setup for a GetNCChanges call req8 = drsuapi.DsGetNCChangesRequest8() - req8.destination_dsa_guid = destination_dsa_guid - req8.source_dsa_invocation_id = source_dsa_invocation_id - req8.naming_context = drsuapi.DsReplicaObjectIdentifier() - req8.naming_context.dn = dn - req8.highwatermark = drsuapi.DsReplicaHighWaterMark() - req8.highwatermark.tmp_highest_usn = 0 - req8.highwatermark.reserved_usn = 0 - req8.highwatermark.highest_usn = 0 - req8.uptodateness_vector = None + req8.destination_dsa_guid = destination_dsa_guid + req8.source_dsa_invocation_id = source_dsa_invocation_id + req8.naming_context = drsuapi.DsReplicaObjectIdentifier() + req8.naming_context.dn = dn + req8.highwatermark = drsuapi.DsReplicaHighWaterMark() + req8.highwatermark.tmp_highest_usn = 0 + req8.highwatermark.reserved_usn = 0 + req8.highwatermark.highest_usn = 0 + req8.uptodateness_vector = None if replica_flags is not None: req8.replica_flags = replica_flags elif exop == drsuapi.DRSUAPI_EXOP_REPL_SECRET: - req8.replica_flags = 0 + req8.replica_flags = 0 else: - req8.replica_flags = (drsuapi.DRSUAPI_DRS_INIT_SYNC | - drsuapi.DRSUAPI_DRS_PER_SYNC | - drsuapi.DRSUAPI_DRS_GET_ANC | - drsuapi.DRSUAPI_DRS_NEVER_SYNCED) + req8.replica_flags = (drsuapi.DRSUAPI_DRS_INIT_SYNC | + drsuapi.DRSUAPI_DRS_PER_SYNC | + drsuapi.DRSUAPI_DRS_GET_ANC | + drsuapi.DRSUAPI_DRS_NEVER_SYNCED) if rodc: req8.replica_flags |= drsuapi.DRSUAPI_DRS_SPECIAL_SECRET_PROCESSING else: diff --git a/python/samba/provision/backend.py b/python/samba/provision/backend.py index dbea3ead83f..cffdea7218e 100644 --- a/python/samba/provision/backend.py +++ b/python/samba/provision/backend.py @@ -377,7 +377,7 @@ class OpenLDAPBackend(LDAPBackend): attrs = ["linkID", "lDAPDisplayName"] res = self.schema.ldb.search(expression="(&(objectclass=attributeSchema)(searchFlags:1.2.840.113556.1.4.803:=1))", base=self.names.schemadn, scope=SCOPE_ONELEVEL, attrs=attrs) index_config = "" - for i in range (0, len(res)): + for i in range(0, len(res)): index_attr = res[i]["lDAPDisplayName"][0] if index_attr == "objectGUID": index_attr = "entryUUID" @@ -736,7 +736,7 @@ class FDSBackend(LDAPBackend): attrs = ["lDAPDisplayName"] res = self.schema.ldb.search(expression="(&(objectclass=attributeSchema)(searchFlags:1.2.840.113556.1.4.803:=1))", base=self.names.schemadn, scope=SCOPE_ONELEVEL, attrs=attrs) - for i in range (0, len(res)): + for i in range(0, len(res)): attr = res[i]["lDAPDisplayName"][0] if attr == "objectGUID": diff --git a/python/samba/schema.py b/python/samba/schema.py index 5c8f506f26e..4e6381306ca 100644 --- a/python/samba/schema.py +++ b/python/samba/schema.py @@ -160,7 +160,7 @@ def get_linked_attributes(schemadn,schemaldb): attrs = ["linkID", "lDAPDisplayName"] res = schemaldb.search(expression="(&(linkID=*)(!(linkID:1.2.840.113556.1.4.803:=1))(objectclass=attributeSchema)(attributeSyntax=2.5.5.1))", base=schemadn, scope=SCOPE_ONELEVEL, attrs=attrs) attributes = {} - for i in range (0, len(res)): + for i in range(0, len(res)): expression = "(&(objectclass=attributeSchema)(linkID=%d)(attributeSyntax=2.5.5.1))" % (int(res[i]["linkID"][0])+1) target = schemaldb.searchone(basedn=schemadn, expression=expression, @@ -178,7 +178,7 @@ def get_dnsyntax_attributes(schemadn,schemaldb): base=schemadn, scope=SCOPE_ONELEVEL, attrs=["linkID", "lDAPDisplayName"]) attributes = [] - for i in range (0, len(res)): + for i in range(0, len(res)): attributes.append(str(res[i]["lDAPDisplayName"])) return attributes diff --git a/python/samba/tests/samba3.py b/python/samba/tests/samba3.py index 51d76dd94c0..f449c64142a 100644 --- a/python/samba/tests/samba3.py +++ b/python/samba/tests/samba3.py @@ -63,7 +63,7 @@ class RegistryTestCase(TestCase): class PassdbTestCase(TestCaseInTempDir): def setUp(self): - super (PassdbTestCase, self).setUp() + super(PassdbTestCase, self).setUp() os.system("cp -r %s %s" % (DATADIR, self.tempdir)) datadir = os.path.join(self.tempdir, "samba3") diff --git a/selftest/selftesthelpers.py b/selftest/selftesthelpers.py index 40e38aab8b1..0e2033bd2e3 100644 --- a/selftest/selftesthelpers.py +++ b/selftest/selftesthelpers.py @@ -18,7 +18,6 @@ # three separated by newlines. All other lines in the output are considered # comments. -import errno import os import subprocess import sys diff --git a/source4/scripting/bin/samba_kcc b/source4/scripting/bin/samba_kcc index 617cad26cb0..9d26848d2d0 100755 --- a/source4/scripting/bin/samba_kcc +++ b/source4/scripting/bin/samba_kcc @@ -655,8 +655,8 @@ class KCC(object): res = self.samdb.search(base=pdnstr, scope=ldb.SCOPE_BASE, attrs=attrs) except ldb.ldbError, (enum, estr): - raise Exception \ - ("Unable to find attr (%s) for (%s) - (%s)" % + raise Exception( + "Unable to find attr (%s) for (%s) - (%s)" % (x_transport.address_attr, pdnstr, estr)) msg = res[0] -- 2.34.1