Skip to content

Commit

Permalink
PEP8: fix E131: continuation line unaligned for hanging indent
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Guo <[email protected]>
Reviewed-by: Andrew Bartlett <[email protected]>
Reviewed-by: Douglas Bagnall <[email protected]>
  • Loading branch information
catalyst-joe-guo authored and douglasbagnall committed Aug 24, 2018
1 parent 5d53254 commit 944d704
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 123 deletions.
2 changes: 1 addition & 1 deletion python/samba/gp_sec_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def ch_minPwdLength(self, val):
old_val = self.ldb.get_minPwdLength()
self.logger.info(
'KDC Minimum Password length was changed from %s to %s' \
% (old_val, val))
% (old_val, val))
self.gp_db.store(str(self), self.attribute, str(old_val))
self.ldb.set_minPwdLength(val)

Expand Down
6 changes: 3 additions & 3 deletions python/samba/netcmd/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -1228,15 +1228,15 @@ def run(self, subcommand, H=None, forest_level=None, domain_level=None,
m.dn = ldb.Dn(samdb, domain_dn)
m["msDS-Behavior-Version"]= ldb.MessageElement(
str(new_level_domain), ldb.FLAG_MOD_REPLACE,
"msDS-Behavior-Version")
"msDS-Behavior-Version")
samdb.modify(m)
# Under partitions
m = ldb.Message()
m.dn = ldb.Dn(samdb, "CN=" + lp.get("workgroup")
+ ",CN=Partitions,%s" % samdb.get_config_basedn())
m["msDS-Behavior-Version"]= ldb.MessageElement(
str(new_level_domain), ldb.FLAG_MOD_REPLACE,
"msDS-Behavior-Version")
"msDS-Behavior-Version")
try:
samdb.modify(m)
except ldb.LdbError as e2:
Expand Down Expand Up @@ -1268,7 +1268,7 @@ def run(self, subcommand, H=None, forest_level=None, domain_level=None,
m.dn = ldb.Dn(samdb, "CN=Partitions,%s" % samdb.get_config_basedn())
m["msDS-Behavior-Version"]= ldb.MessageElement(
str(new_level_forest), ldb.FLAG_MOD_REPLACE,
"msDS-Behavior-Version")
"msDS-Behavior-Version")
samdb.modify(m)
msgs.append("Forest function level changed!")
msgs.append("All changes applied successfully!")
Expand Down
2 changes: 1 addition & 1 deletion python/samba/tests/netcmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,4 @@ def test_short_description_everywhere(self):
return
self.fail(
"The following commands do not have a short description set: %r" %
missing)
missing)
4 changes: 2 additions & 2 deletions python/samba/tests/samba_tool/ou.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def test_newou(self):
for ou in self.ous:
(result, out, err) = self.runsubcmd(
"ou", "create", "OU=%s" % ou["name"],
"--description=%s" % ou["description"])
"--description=%s" % ou["description"])

self.assertCmdSuccess(result, out, err)
self.assertEquals(err, "", "There shouldn't be any error message")
Expand All @@ -115,7 +115,7 @@ def test_newou(self):
full_ou_dn = self.samdb.normalize_dn_in_domain("OU=%s" % ou["name"])
(result, out, err) = self.runsubcmd(
"ou", "create", str(full_ou_dn),
"--description=%s" % ou["description"])
"--description=%s" % ou["description"])

self.assertCmdSuccess(result, out, err)
self.assertEquals(err, "", "There shouldn't be any error message")
Expand Down
86 changes: 43 additions & 43 deletions source4/dsdb/tests/python/ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ def test_objectclasses(self):
# Objects instanciated using "satisfied" abstract classes (concrete
# subclasses) are allowed
self.ldb.add({
"dn": "cn=ldaptestuser,cn=users," + self.base_dn,
"objectClass": ["top", "leaf", "connectionPoint", "serviceConnectionPoint"] })
"dn": "cn=ldaptestuser,cn=users," + self.base_dn,
"objectClass": ["top", "leaf", "connectionPoint", "serviceConnectionPoint"] })

delete_force(self.ldb, "cn=ldaptestuser,cn=users," + self.base_dn)

Expand All @@ -196,9 +196,9 @@ def test_objectclasses(self):

# Test allowed system flags
self.ldb.add({
"dn": "cn=ldaptestuser,cn=users," + self.base_dn,
"objectClass": "person",
"systemFlags": str(~(SYSTEM_FLAG_CONFIG_ALLOW_RENAME | SYSTEM_FLAG_CONFIG_ALLOW_MOVE | SYSTEM_FLAG_CONFIG_ALLOW_LIMITED_MOVE)) })
"dn": "cn=ldaptestuser,cn=users," + self.base_dn,
"objectClass": "person",
"systemFlags": str(~(SYSTEM_FLAG_CONFIG_ALLOW_RENAME | SYSTEM_FLAG_CONFIG_ALLOW_MOVE | SYSTEM_FLAG_CONFIG_ALLOW_LIMITED_MOVE)) })

res = ldb.search("cn=ldaptestuser,cn=users," + self.base_dn,
scope=SCOPE_BASE, attrs=["systemFlags"])
Expand All @@ -208,8 +208,8 @@ def test_objectclasses(self):
delete_force(self.ldb, "cn=ldaptestuser,cn=users," + self.base_dn)

self.ldb.add({
"dn": "cn=ldaptestuser,cn=users," + self.base_dn,
"objectClass": "person" })
"dn": "cn=ldaptestuser,cn=users," + self.base_dn,
"objectClass": "person" })

# We can remove derivation classes of the structural objectclass
# but they're going to be readded afterwards
Expand Down Expand Up @@ -417,8 +417,8 @@ def test_objectclasses(self):
delete_force(self.ldb, "cn=ldaptestuser,cn=users," + self.base_dn)

self.ldb.add({
"dn": "cn=ldaptestuser,cn=users," + self.base_dn,
"objectClass": "user" })
"dn": "cn=ldaptestuser,cn=users," + self.base_dn,
"objectClass": "user" })

# Add a new top-most structural class "container". This does not work
# since it stands in no direct relation to the current one.
Expand Down Expand Up @@ -573,7 +573,7 @@ def test_invalid_parent(self):
try:
self.ldb.add({
"dn": "cn=ldaptestgroup,cn=thisdoesnotexist123,"
+ self.base_dn,
+ self.base_dn,
"objectclass": "group"})
self.fail()
except LdbError as e24:
Expand Down Expand Up @@ -611,8 +611,8 @@ def test_invalid_attribute(self):
self.assertEquals(num, ERR_NO_SUCH_ATTRIBUTE)

self.ldb.add({
"dn": "cn=ldaptestgroup,cn=users," + self.base_dn,
"objectclass": "group"})
"dn": "cn=ldaptestgroup,cn=users," + self.base_dn,
"objectclass": "group"})

# modify operation

Expand Down Expand Up @@ -723,8 +723,8 @@ def test_single_valued_attributes(self):
self.assertEquals(num, ERR_CONSTRAINT_VIOLATION)

self.ldb.add({
"dn": "cn=ldaptestgroup,cn=users," + self.base_dn,
"objectclass": "group"})
"dn": "cn=ldaptestgroup,cn=users," + self.base_dn,
"objectclass": "group"})

m = Message()
m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
Expand Down Expand Up @@ -904,8 +904,8 @@ def test_attribute_ranges(self):
try:
ldb.add({
"dn": "cn=ldaptestuser,cn=users," + self.base_dn,
"objectClass": "person",
"sn": "" })
"objectClass": "person",
"sn": "" })
self.fail()
except LdbError as e39:
(num, _) = e39.args
Expand All @@ -923,7 +923,7 @@ def test_attribute_ranges(self):

ldb.add({
"dn": "cn=ldaptestuser,cn=users," + self.base_dn,
"objectClass": "person" })
"objectClass": "person" })

# Too short (min. 1)
m = Message()
Expand Down Expand Up @@ -1056,8 +1056,8 @@ def test_instanceType(self):
self.assertEquals(num, ERR_UNWILLING_TO_PERFORM)

self.ldb.add({
"dn": "cn=ldaptestgroup,cn=users," + self.base_dn,
"objectclass": "group"})
"dn": "cn=ldaptestgroup,cn=users," + self.base_dn,
"objectclass": "group"})

m = Message()
m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
Expand Down Expand Up @@ -1122,9 +1122,9 @@ def test_distinguished_name(self):

# a wrong "distinguishedName" attribute is obviously tolerated
self.ldb.add({
"dn": "cn=ldaptestgroup,cn=users," + self.base_dn,
"objectclass": "group",
"distinguishedName": "cn=ldaptest,cn=users," + self.base_dn})
"dn": "cn=ldaptestgroup,cn=users," + self.base_dn,
"objectclass": "group",
"distinguishedName": "cn=ldaptest,cn=users," + self.base_dn})

# proof if the DN has been set correctly
res = ldb.search("cn=ldaptestgroup,cn=users," + self.base_dn,
Expand All @@ -1139,7 +1139,7 @@ def test_distinguished_name(self):
m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
m["dn"] = MessageElement(
"cn=ldaptestgroup,cn=users," + self.base_dn, FLAG_MOD_REPLACE,
"dn")
"dn")
try:
ldb.modify(m)
self.fail()
Expand All @@ -1151,7 +1151,7 @@ def test_distinguished_name(self):
m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
m["distinguishedName"] = MessageElement(
"cn=ldaptestuser,cn=users," + self.base_dn, FLAG_MOD_ADD,
"distinguishedName")
"distinguishedName")

try:
ldb.modify(m)
Expand All @@ -1164,7 +1164,7 @@ def test_distinguished_name(self):
m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
m["distinguishedName"] = MessageElement(
"cn=ldaptestuser,cn=users," + self.base_dn, FLAG_MOD_REPLACE,
"distinguishedName")
"distinguishedName")

try:
ldb.modify(m)
Expand All @@ -1177,7 +1177,7 @@ def test_distinguished_name(self):
m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
m["distinguishedName"] = MessageElement(
"cn=ldaptestuser,cn=users," + self.base_dn, FLAG_MOD_DELETE,
"distinguishedName")
"distinguishedName")

try:
ldb.modify(m)
Expand Down Expand Up @@ -1220,8 +1220,8 @@ def test_rdn_name(self):
# empty RDN
try:
self.ldb.add({
"dn": "=,cn=users," + self.base_dn,
"objectclass": "group"})
"dn": "=,cn=users," + self.base_dn,
"objectclass": "group"})
self.fail()
except LdbError as e61:
(num, _) = e61.args
Expand All @@ -1230,8 +1230,8 @@ def test_rdn_name(self):
# empty RDN name
try:
self.ldb.add({
"dn": "=ldaptestgroup,cn=users," + self.base_dn,
"objectclass": "group"})
"dn": "=ldaptestgroup,cn=users," + self.base_dn,
"objectclass": "group"})
self.fail()
except LdbError as e62:
(num, _) = e62.args
Expand All @@ -1240,8 +1240,8 @@ def test_rdn_name(self):
# empty RDN value
try:
self.ldb.add({
"dn": "cn=,cn=users," + self.base_dn,
"objectclass": "group"})
"dn": "cn=,cn=users," + self.base_dn,
"objectclass": "group"})
self.fail()
except LdbError as e63:
(num, _) = e63.args
Expand All @@ -1250,8 +1250,8 @@ def test_rdn_name(self):
# a wrong RDN candidate
try:
self.ldb.add({
"dn": "description=xyz,cn=users," + self.base_dn,
"objectclass": "group"})
"dn": "description=xyz,cn=users," + self.base_dn,
"objectclass": "group"})
self.fail()
except LdbError as e64:
(num, _) = e64.args
Expand All @@ -1261,9 +1261,9 @@ def test_rdn_name(self):

# a wrong "name" attribute is obviously tolerated
self.ldb.add({
"dn": "cn=ldaptestgroup,cn=users," + self.base_dn,
"objectclass": "group",
"name": "ldaptestgroupx"})
"dn": "cn=ldaptestgroup,cn=users," + self.base_dn,
"objectclass": "group",
"name": "ldaptestgroupx"})

# proof if the name has been set correctly
res = ldb.search("cn=ldaptestgroup,cn=users," + self.base_dn,
Expand Down Expand Up @@ -1417,8 +1417,8 @@ def test_rename(self):
self.assertEquals(num, ERR_NO_SUCH_OBJECT)

self.ldb.add({
"dn": "cn=ldaptestuser2,cn=users," + self.base_dn,
"objectclass": "user" })
"dn": "cn=ldaptestuser2,cn=users," + self.base_dn,
"objectclass": "user" })

ldb.rename("cn=ldaptestuser2,cn=users," + self.base_dn, "cn=ldaptestuser2,cn=users," + self.base_dn)
ldb.rename("cn=ldaptestuser2,cn=users," + self.base_dn, "cn=ldaptestuser3,cn=users," + self.base_dn)
Expand Down Expand Up @@ -1523,14 +1523,14 @@ def test_rename(self):
def test_rename_twice(self):
"""Tests the rename operation twice - this corresponds to a past bug"""
self.ldb.add({
"dn": "cn=ldaptestuser5,cn=users," + self.base_dn,
"objectclass": "user" })
"dn": "cn=ldaptestuser5,cn=users," + self.base_dn,
"objectclass": "user" })

ldb.rename("cn=ldaptestuser5,cn=users," + self.base_dn, "cn=ldaptestUSER5,cn=users," + self.base_dn)
delete_force(self.ldb, "cn=ldaptestuser5,cn=users," + self.base_dn)
self.ldb.add({
"dn": "cn=ldaptestuser5,cn=users," + self.base_dn,
"objectclass": "user" })
"dn": "cn=ldaptestuser5,cn=users," + self.base_dn,
"objectclass": "user" })
ldb.rename("cn=ldaptestuser5,cn=Users," + self.base_dn, "cn=ldaptestUSER5,cn=users," + self.base_dn)
res = ldb.search(expression="cn=ldaptestuser5")
self.assertEquals(len(res), 1, "Wrong number of hits for cn=ldaptestuser5")
Expand Down
Loading

0 comments on commit 944d704

Please sign in to comment.