diff options
author | Joe Guo <joeg@catalyst.net.nz> | 2018-07-30 18:22:01 +1200 |
---|---|---|
committer | Douglas Bagnall <dbagnall@samba.org> | 2018-08-24 07:49:30 +0200 |
commit | 7b031b01a1fa458cb118e5fb38faf20bd5379e5c (patch) | |
tree | 8a8e35296e2e21bc7ac1c51b4f259b0c262a857c | |
parent | 95c36d825c68505dd28fda2a1bf7bcc707c523ad (diff) | |
download | samba-7b031b01a1fa458cb118e5fb38faf20bd5379e5c.tar.gz |
PEP8: fix E502: the backslash is redundant between brackets
Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
-rwxr-xr-x | lib/ldb/tests/python/api.py | 2 | ||||
-rw-r--r-- | python/samba/dbchecker.py | 4 | ||||
-rw-r--r-- | python/samba/emulate/traffic.py | 2 | ||||
-rw-r--r-- | python/samba/gp_sec_ext.py | 8 | ||||
-rw-r--r-- | python/samba/gpclass.py | 4 | ||||
-rw-r--r-- | python/samba/join.py | 2 | ||||
-rw-r--r-- | python/samba/remove_dc.py | 10 | ||||
-rw-r--r-- | python/samba/tests/dcerpc/dnsserver.py | 30 | ||||
-rw-r--r-- | python/samba/tests/gpo.py | 2 | ||||
-rw-r--r-- | python/samba/tests/samba_tool/dnscmd.py | 90 | ||||
-rwxr-xr-x | source3/torture/test_ntlm_auth.py | 28 | ||||
-rwxr-xr-x | source4/dsdb/tests/python/acl.py | 12 | ||||
-rwxr-xr-x | source4/dsdb/tests/python/deletetest.py | 2 | ||||
-rwxr-xr-x | source4/dsdb/tests/python/sec_descriptor.py | 6 | ||||
-rwxr-xr-x | source4/scripting/devel/repl_cleartext_pwd.py | 10 | ||||
-rw-r--r-- | source4/torture/drs/python/repl_move.py | 4 | ||||
-rw-r--r-- | source4/torture/drs/python/repl_schema.py | 4 | ||||
-rw-r--r-- | wintest/wintest.py | 6 |
18 files changed, 113 insertions, 113 deletions
diff --git a/lib/ldb/tests/python/api.py b/lib/ldb/tests/python/api.py index 13fe43a2381..e304bb2d043 100755 --- a/lib/ldb/tests/python/api.py +++ b/lib/ldb/tests/python/api.py @@ -1175,7 +1175,7 @@ class SearchTests(LdbBaseTest): expression="(dn=OU=OU1,DC=SAMBA,DC=ORG)") if hasattr(self, 'disallowDNFilter') and \ hasattr(self, 'IDX') and \ - (hasattr(self, 'IDXGUID') or \ + (hasattr(self, 'IDXGUID') or ((hasattr(self, 'IDXONE') == False and hasattr(self, 'IDX')))): self.assertEqual(len(res11), 0) else: diff --git a/python/samba/dbchecker.py b/python/samba/dbchecker.py index 158698907b9..bdc1874f563 100644 --- a/python/samba/dbchecker.py +++ b/python/samba/dbchecker.py @@ -739,7 +739,7 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base))) check_duplicates=True): '''handle a orphaned backlink value''' if check_duplicates is True and self.has_duplicate_links(target_dn, forward_attr, forward_syntax): - self.report("WARNING: Keep orphaned backlink attribute " + \ + self.report("WARNING: Keep orphaned backlink attribute " + "'%s' in '%s' for link '%s' in '%s'" % ( backlink_attr, obj_dn, forward_attr, target_dn)) return @@ -1040,7 +1040,7 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base))) return (missing_forward_links, error_count) if "sortedLinks" in self.compatibleFeatures: - self.report("Not checking for missing forward links because the db " + \ + self.report("Not checking for missing forward links because the db " + "has the sortedLinks feature") return (missing_forward_links, error_count) diff --git a/python/samba/emulate/traffic.py b/python/samba/emulate/traffic.py index a60ebbba9e2..8f580428c9d 100644 --- a/python/samba/emulate/traffic.py +++ b/python/samba/emulate/traffic.py @@ -238,7 +238,7 @@ class Packet(object): fn = getattr(traffic_packets, fn_name) except AttributeError as e: - print("Conversation(%s) Missing handler %s" % \ + print("Conversation(%s) Missing handler %s" % (conversation.conversation_id, fn_name), file=sys.stderr) return diff --git a/python/samba/gp_sec_ext.py b/python/samba/gp_sec_ext.py index 7b65b768fee..439d016f0a0 100644 --- a/python/samba/gp_sec_ext.py +++ b/python/samba/gp_sec_ext.py @@ -57,14 +57,14 @@ class inf_to_ldb(gp_ext_setter): def ch_minPwdAge(self, val): old_val = self.ldb.get_minPwdAge() - self.logger.info('KDC Minimum Password age was changed from %s to %s' \ + self.logger.info('KDC Minimum Password age was changed from %s to %s' % (old_val, val)) self.gp_db.store(str(self), self.attribute, str(old_val)) self.ldb.set_minPwdAge(val) def ch_maxPwdAge(self, val): old_val = self.ldb.get_maxPwdAge() - self.logger.info('KDC Maximum Password age was changed from %s to %s' \ + self.logger.info('KDC Maximum Password age was changed from %s to %s' % (old_val, val)) self.gp_db.store(str(self), self.attribute, str(old_val)) self.ldb.set_maxPwdAge(val) @@ -72,14 +72,14 @@ class inf_to_ldb(gp_ext_setter): def ch_minPwdLength(self, val): old_val = self.ldb.get_minPwdLength() self.logger.info( - 'KDC Minimum Password length was changed from %s to %s' \ + 'KDC Minimum Password length was changed from %s to %s' % (old_val, val)) self.gp_db.store(str(self), self.attribute, str(old_val)) self.ldb.set_minPwdLength(val) def ch_pwdProperties(self, val): old_val = self.ldb.get_pwdProperties() - self.logger.info('KDC Password Properties were changed from %s to %s' \ + self.logger.info('KDC Password Properties were changed from %s to %s' % (old_val, val)) self.gp_db.store(str(self), self.attribute, str(old_val)) self.ldb.set_pwdProperties(val) diff --git a/python/samba/gpclass.py b/python/samba/gpclass.py index a5e611fc0e5..22f57c0dd95 100644 --- a/python/samba/gpclass.py +++ b/python/samba/gpclass.py @@ -476,7 +476,7 @@ def apply_gp(lp, creds, test_ldb, logger, store, gp_extensions): try: check_refresh_gpo_list(dc_hostname, lp, creds, gpos) except: - logger.error('Failed downloading gpt cache from \'%s\' using SMB' \ + logger.error('Failed downloading gpt cache from \'%s\' using SMB' % dc_hostname) return @@ -497,7 +497,7 @@ def apply_gp(lp, creds, test_ldb, logger, store, gp_extensions): try: ext.parse(ext.list(path), test_ldb, gp_db, lp) except Exception as e: - logger.error('Failed to parse gpo %s for extension %s' % \ + logger.error('Failed to parse gpo %s for extension %s' % (guid, str(ext))) logger.error('Message was: ' + str(e)) store.cancel() diff --git a/python/samba/join.py b/python/samba/join.py index 803379746e1..ebcfea84444 100644 --- a/python/samba/join.py +++ b/python/samba/join.py @@ -1053,7 +1053,7 @@ class DCJoinContext(object): cname_target = "%s.%s" % (name, zone) IPs = samba.interface_ips(ctx.lp, ctx.force_all_ips) - ctx.logger.info("Adding %d remote DNS records for %s.%s" % \ + ctx.logger.info("Adding %d remote DNS records for %s.%s" % (len(IPs), name, zone)) binding_options = "sign" diff --git a/python/samba/remove_dc.py b/python/samba/remove_dc.py index 2043932d39f..3dc93741a45 100644 --- a/python/samba/remove_dc.py +++ b/python/samba/remove_dc.py @@ -46,10 +46,10 @@ def remove_sysvol_references(samdb, logger, dc_name): # This is verbose, but it is the safe, escape-proof way # to add a base and add an arbitrary RDN. if dn.add_base(samdb.get_config_basedn()) == False: - raise DemoteException("Failed constructing DN %s by adding base %s" \ + raise DemoteException("Failed constructing DN %s by adding base %s" % (dn, samdb.get_config_basedn())) if dn.add_child("CN=X") == False: - raise DemoteException("Failed constructing DN %s by adding child CN=X"\ + raise DemoteException("Failed constructing DN %s by adding child CN=X" % (dn)) dn.set_component(0, "CN", dc_name) try: @@ -69,7 +69,7 @@ def remove_sysvol_references(samdb, logger, dc_name): # to add a base and add an arbitrary RDN. dn = ldb.Dn(samdb, s) if dn.add_base(samdb.get_default_basedn()) == False: - raise DemoteException("Failed constructing DN %s by adding base" % \ + raise DemoteException("Failed constructing DN %s by adding base" % (dn, samdb.get_default_basedn())) if dn.add_child("CN=X") == False: raise DemoteException("Failed constructing DN %s by adding child " @@ -160,7 +160,7 @@ def remove_dns_references(samdb, logger, dnsHostName, ignore_no_name=False): a_recs = [r for r in a_recs if not a_rec_to_remove(r)] if len(a_recs) != orig_num_recs: - logger.info("updating %s keeping %d values, removing %s values" % \ + logger.info("updating %s keeping %d values, removing %s values" % (a_name, len(a_recs), orig_num_recs - len(a_recs))) samdb.dns_replace(a_name, a_recs) @@ -201,7 +201,7 @@ def remove_hanging_dns_references(samdb, logger, dnsHostNameUpper, zones): for v in orig_values if not to_remove(v)] if len(values) != len(orig_values): - logger.info("updating %s keeping %d values, removing %s values" \ + logger.info("updating %s keeping %d values, removing %s values" % (record.dn, len(values), len(orig_values) - len(values))) diff --git a/python/samba/tests/dcerpc/dnsserver.py b/python/samba/tests/dcerpc/dnsserver.py index abace736c5b..e63eccb6332 100644 --- a/python/samba/tests/dcerpc/dnsserver.py +++ b/python/samba/tests/dcerpc/dnsserver.py @@ -921,11 +921,11 @@ class DnsserverTests(RpcInterfaceTestCase): dns_admin = str(ndr_unpack(security.dom_sid, res[0]['objectSid'][0])) - packed_sd = descriptor.sddl2binary("O:SYG:BA" \ - "D:AI(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;DA)" \ - "(A;;CC;;;AU)" \ - "(A;;RPLCLORC;;;WD)" \ - "(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)" \ + packed_sd = descriptor.sddl2binary("O:SYG:BA" + "D:AI(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;DA)" + "(A;;CC;;;AU)" + "(A;;RPLCLORC;;;WD)" + "(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)" "(A;CI;RPWPCRCCDCLCRCWOWDSDDTSW;;;ED)", domain_sid, {"DnsAdmins": dns_admin}) expected_sd = descriptor.get_clean_sd(ndr_unpack(security.descriptor, packed_sd)) @@ -981,11 +981,11 @@ class DnsserverTests(RpcInterfaceTestCase): dns_admin = str(ndr_unpack(security.dom_sid, res[0]['objectSid'][0])) - packed_sd = descriptor.sddl2binary("O:DAG:DA" \ - "D:AI(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;DA)" \ - "(A;;CC;;;AU)" \ - "(A;;RPLCLORC;;;WD)" \ - "(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)" \ + packed_sd = descriptor.sddl2binary("O:DAG:DA" + "D:AI(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;DA)" + "(A;;CC;;;AU)" + "(A;;RPLCLORC;;;WD)" + "(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)" "(A;CI;RPWPCRCCDCLCRCWOWDSDDTSW;;;ED)", domain_sid, {"DnsAdmins": dns_admin}) expected_sd = descriptor.get_clean_sd(ndr_unpack(security.descriptor, packed_sd)) @@ -1053,11 +1053,11 @@ class DnsserverTests(RpcInterfaceTestCase): dns_admin = str(ndr_unpack(security.dom_sid, res[0]['objectSid'][0])) - packed_sd = descriptor.sddl2binary("O:DAG:DA" \ - "D:AI(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;DA)" \ - "(A;;CC;;;AU)" \ - "(A;;RPLCLORC;;;WD)" \ - "(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)" \ + packed_sd = descriptor.sddl2binary("O:DAG:DA" + "D:AI(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;DA)" + "(A;;CC;;;AU)" + "(A;;RPLCLORC;;;WD)" + "(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)" "(A;CI;RPWPCRCCDCLCRCWOWDSDDTSW;;;ED)", domain_sid, {"DnsAdmins": dns_admin}) expected_sd = descriptor.get_clean_sd(ndr_unpack(security.descriptor, packed_sd)) diff --git a/python/samba/tests/gpo.py b/python/samba/tests/gpo.py index 811d28d341f..ce766cd8746 100644 --- a/python/samba/tests/gpo.py +++ b/python/samba/tests/gpo.py @@ -109,7 +109,7 @@ class GPOTests(tests.TestCase): after = 'addom.samba.example.com/Policies/' \ '{31B2F340-016D-11D2-945F-00C04FB984F9}/GPT.INI' result = check_safe_path(before) - self.assertEquals(result, after, 'check_safe_path() didn\'t' \ + self.assertEquals(result, after, 'check_safe_path() didn\'t' ' correctly convert \\ to /') def test_gpt_ext_register(self): diff --git a/python/samba/tests/samba_tool/dnscmd.py b/python/samba/tests/samba_tool/dnscmd.py index c204055389e..64e34dc3af2 100644 --- a/python/samba/tests/samba_tool/dnscmd.py +++ b/python/samba/tests/samba_tool/dnscmd.py @@ -185,10 +185,10 @@ class DnsCmdTestCase(SambaToolCmdTest): self.creds_string) try: self.assertCmdSuccess(result, out, err, - "Failed to query for a record" \ + "Failed to query for a record" "which had DNS_RANK_NONE.") self.assertTrue("testrecord" in out and record_str in out, - "Query for a record which had DNS_RANK_NONE" \ + "Query for a record which had DNS_RANK_NONE" "succeeded but produced no resulting records.") except AssertionError as e: # Windows produces no resulting records @@ -199,7 +199,7 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", record_type_str, record_str, self.creds_string) try: - self.assertCmdFail(result, "Successfully added duplicate record" \ + self.assertCmdFail(result, "Successfully added duplicate record" "of one which had DNS_RANK_NONE.") except AssertionError as e: errors.append(e) @@ -209,7 +209,7 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", record_type_str, record_str, self.creds_string) try: - self.assertCmdSuccess(result, out, err, "Failed to delete record" \ + self.assertCmdSuccess(result, out, err, "Failed to delete record" "which had DNS_RANK_NONE.") except AssertionError as e: errors.append(e) @@ -219,7 +219,7 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", record_type_str, self.creds_string) try: - self.assertCmdFail(result, "Successfully queried for deleted record" \ + self.assertCmdFail(result, "Successfully queried for deleted record" "which had DNS_RANK_NONE.") except AssertionError as e: errors.append(e) @@ -244,7 +244,7 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", dnstype, record, self.creds_string) - self.assertCmdSuccess(result, out, err, "Failed to add" \ + self.assertCmdSuccess(result, out, err, "Failed to add" "record %s with type %s." % (record, dnstype)) @@ -253,7 +253,7 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", dnstype, self.creds_string) - self.assertCmdSuccess(result, out, err, "Failed to query" \ + self.assertCmdSuccess(result, out, err, "Failed to query" "record %s with qualifier %s." % (record, dnstype)) @@ -262,7 +262,7 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", dnstype, record, self.creds_string) - self.assertCmdSuccess(result, out, err, "Failed to remove" \ + self.assertCmdSuccess(result, out, err, "Failed to remove" "record %s with type %s." % (record, dnstype)) except AssertionError as e: @@ -272,7 +272,7 @@ class DnsCmdTestCase(SambaToolCmdTest): if num_failures > 0: for msg in failure_msgs: print(msg) - self.fail("Failed to accept valid commands. %d total failures." \ + self.fail("Failed to accept valid commands. %d total failures." "Errors above." % num_failures) def test_reject_invalid_commands(self): @@ -292,7 +292,7 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", dnstype, record, self.creds_string) - self.assertCmdFail(result, "Successfully added invalid" \ + self.assertCmdFail(result, "Successfully added invalid" "record '%s' of type '%s'." % (record, dnstype)) except AssertionError as e: @@ -305,8 +305,8 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", dnstype, record, self.creds_string) - self.assertCmdFail(result, "Successfully deleted invalid" \ - "record '%s' of type '%s' which" \ + self.assertCmdFail(result, "Successfully deleted invalid" + "record '%s' of type '%s' which" "shouldn't exist." % (record, dnstype)) except AssertionError as e: num_failures = num_failures + 1 @@ -325,7 +325,7 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", dnstype, good_record, self.creds_string) - self.assertCmdSuccess(result, out, err, "Failed to add " \ + self.assertCmdSuccess(result, out, err, "Failed to add " "record '%s' with type %s." % (record, dnstype)) @@ -335,8 +335,8 @@ class DnsCmdTestCase(SambaToolCmdTest): dnstype, good_record, bad_record, self.creds_string) - self.assertCmdFail(result, "Successfully updated valid " \ - "record '%s' of type '%s' to invalid " \ + self.assertCmdFail(result, "Successfully updated valid " + "record '%s' of type '%s' to invalid " "record '%s' of the same type." % (good_record, dnstype, bad_record)) @@ -345,7 +345,7 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", dnstype, good_record, self.creds_string) - self.assertCmdSuccess(result, out, err, "Could not delete " \ + self.assertCmdSuccess(result, out, err, "Could not delete " "valid record '%s' of type '%s'." % (good_record, dnstype)) except AssertionError as e: @@ -356,7 +356,7 @@ class DnsCmdTestCase(SambaToolCmdTest): if num_failures > 0: for msg in failure_msgs: print(msg) - self.fail("Failed to reject invalid commands. %d total failures. " \ + self.fail("Failed to reject invalid commands. %d total failures. " "Errors above." % num_failures) def test_update_invalid_type(self): @@ -370,7 +370,7 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", dnstype1, record1, self.creds_string) - self.assertCmdSuccess(result, out, err, "Failed to add " \ + self.assertCmdSuccess(result, out, err, "Failed to add " "record %s with type %s." % (record1, dnstype1)) @@ -396,8 +396,8 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", dnstype1, record1, record2, self.creds_string) - self.assertCmdFail(result, "Successfully updated record '%s' " \ - "to '%s', even though the latter is of " \ + self.assertCmdFail(result, "Successfully updated record '%s' " + "to '%s', even though the latter is of " "type '%s' where '%s' was expected." % (record1, record2, dnstype2, dnstype1)) @@ -406,8 +406,8 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", dnstype2, record1, record2, self.creds_string) - self.assertCmdFail(result, "Successfully updated record " \ - "'%s' to '%s', even though the former " \ + self.assertCmdFail(result, "Successfully updated record " + "'%s' to '%s', even though the former " "is of type '%s' where '%s' was expected." % (record1, record2, dnstype1, dnstype2)) @@ -419,7 +419,7 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", dnstype, record, self.creds_string) - self.assertCmdSuccess(result, out, err, "Failed to add " \ + self.assertCmdSuccess(result, out, err, "Failed to add " "record %s with type %s." % (record, dnstype)) @@ -429,7 +429,7 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", dnstype, record, record, self.creds_string) - self.assertCmdFail(result, "Successfully updated record " \ + self.assertCmdFail(result, "Successfully updated record " "'%s' to be exactly the same." % record) result, out, err = self.runsubcmd("dns", "delete", @@ -437,7 +437,7 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", dnstype, record, self.creds_string) - self.assertCmdSuccess(result, out, err, "Could not delete " \ + self.assertCmdSuccess(result, out, err, "Could not delete " "valid record '%s' of type '%s'." % (record, dnstype)) @@ -447,7 +447,7 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", "SRV", record, self.creds_string) - self.assertCmdSuccess(result, out, err, "Failed to add " \ + self.assertCmdSuccess(result, out, err, "Failed to add " "record %s with type 'SRV'." % record) split = record.split(' ') @@ -459,7 +459,7 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", "SRV", record, new_record, self.creds_string) - self.assertCmdSuccess(result, out, err, "Failed to update record " \ + self.assertCmdSuccess(result, out, err, "Failed to update record " "'%s' of type '%s' to '%s'." % (record, "SRV", new_record)) @@ -467,7 +467,7 @@ class DnsCmdTestCase(SambaToolCmdTest): os.environ["SERVER"], self.zone, "testrecord", "SRV", self.creds_string) - self.assertCmdSuccess(result, out, err, "Failed to query for " \ + self.assertCmdSuccess(result, out, err, "Failed to query for " "record '%s' of type '%s'." % (new_record, "SRV")) @@ -476,7 +476,7 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", "SRV", new_record, self.creds_string) - self.assertCmdSuccess(result, out, err, "Could not delete " \ + self.assertCmdSuccess(result, out, err, "Could not delete " "valid record '%s' of type '%s'." % (new_record, "SRV")) @@ -495,7 +495,7 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", dnstype, used_record, self.creds_string) - self.assertCmdSuccess(result, out, err, "Failed to add record %s " \ + self.assertCmdSuccess(result, out, err, "Failed to add record %s " "with type %s." % (used_record, dnstype)) result, out, err = self.runsubcmd("dns", "update", @@ -504,8 +504,8 @@ class DnsCmdTestCase(SambaToolCmdTest): dnstype, unused_record, new_record, self.creds_string) - self.assertCmdFail(result, "Successfully updated record '%s' " \ - "from '%s' to '%s', even though the given " \ + self.assertCmdFail(result, "Successfully updated record '%s' " + "from '%s' to '%s', even though the given " "source record is incorrect." % (used_record, unused_record, new_record)) @@ -515,10 +515,10 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", "SOA", "test", self.creds_string) - self.assertCmdFail(result, "Successfully added record of type SOA, " \ + self.assertCmdFail(result, "Successfully added record of type SOA, " "when this type should not be available.") self.assertTrue("type SOA is not supported" in err, - "Invalid error message '%s' when attempting to " \ + "Invalid error message '%s' when attempting to " "add record of type SOA." % err) def test_add_overlapping_different_type(self): @@ -545,7 +545,7 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", dnstype1, record1, self.creds_string) - self.assertCmdSuccess(result, out, err, "Failed to add record " \ + self.assertCmdSuccess(result, out, err, "Failed to add record " "'%s' of type '%s'." % (record1, dnstype1)) result, out, err = self.runsubcmd("dns", "add", @@ -553,8 +553,8 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", dnstype2, record2, self.creds_string) - self.assertCmdSuccess(result, out, err, "Failed to add record " \ - "'%s' of type '%s' when a record '%s' " \ + self.assertCmdSuccess(result, out, err, "Failed to add record " + "'%s' of type '%s' when a record '%s' " "of type '%s' with the same name exists." % (record1, dnstype1, record2, dnstype2)) @@ -562,9 +562,9 @@ class DnsCmdTestCase(SambaToolCmdTest): os.environ["SERVER"], self.zone, "testrecord", dnstype1, self.creds_string) - self.assertCmdSuccess(result, out, err, "Failed to query for " \ - "record '%s' of type '%s' when a new " \ - "record '%s' of type '%s' with the same " \ + self.assertCmdSuccess(result, out, err, "Failed to query for " + "record '%s' of type '%s' when a new " + "record '%s' of type '%s' with the same " "name was added." % (record1, dnstype1, record2, dnstype2)) @@ -572,9 +572,9 @@ class DnsCmdTestCase(SambaToolCmdTest): os.environ["SERVER"], self.zone, "testrecord", dnstype2, self.creds_string) - self.assertCmdSuccess(result, out, err, "Failed to query " \ - "record '%s' of type '%s' which should " \ - "have been added with the same name as " \ + self.assertCmdSuccess(result, out, err, "Failed to query " + "record '%s' of type '%s' which should " + "have been added with the same name as " "record '%s' of type '%s'." % (record2, dnstype2, record1, dnstype1)) @@ -583,7 +583,7 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", dnstype1, record1, self.creds_string) - self.assertCmdSuccess(result, out, err, "Failed to delete " \ + self.assertCmdSuccess(result, out, err, "Failed to delete " "record '%s' of type '%s'." % (record1, dnstype1)) @@ -592,7 +592,7 @@ class DnsCmdTestCase(SambaToolCmdTest): self.zone, "testrecord", dnstype2, record2, self.creds_string) - self.assertCmdSuccess(result, out, err, "Failed to delete " \ + self.assertCmdSuccess(result, out, err, "Failed to delete " "record '%s' of type '%s'." % (record2, dnstype2)) diff --git a/source3/torture/test_ntlm_auth.py b/source3/torture/test_ntlm_auth.py index 28b83f8cde7..6f9636e6772 100755 --- a/source3/torture/test_ntlm_auth.py +++ b/source3/torture/test_ntlm_auth.py @@ -82,36 +82,36 @@ def parseCommandLine(): parser.set_defaults(server_helper="squid-2.5-ntlmssp") parser.set_defaults(config_file="/etc/samba/smb.conf") - parser.add_option("--client-username", dest="client_username",\ + parser.add_option("--client-username", dest="client_username", help="User name for the client. [default: foo]") - parser.add_option("--client-password", dest="client_password",\ + parser.add_option("--client-password", dest="client_password", help="Password the client will send. [default: secret]") - parser.add_option("--client-domain", dest="client_domain",\ + parser.add_option("--client-domain", dest="client_domain", help="Domain the client authenticates for. [default: FOO]") - parser.add_option("--client-helper", dest="client_helper",\ + parser.add_option("--client-helper", dest="client_helper", help="Helper mode for the ntlm_auth client. [default: ntlmssp-client-1]") - parser.add_option("--client-use-cached-creds", dest="client_use_cached_creds",\ + parser.add_option("--client-use-cached-creds", dest="client_use_cached_creds", help="Use winbindd credentials cache (rather than default username/pw)", action="store_true") - parser.add_option("--target-hostname", dest="target_hostname",\ + parser.add_option("--target-hostname", dest="target_hostname", help="Target hostname for kerberos") - parser.add_option("--target-service", dest="target_service",\ + parser.add_option("--target-service", dest="target_service", help="Target service for kerberos") - parser.add_option("--server-username", dest="server_username",\ + parser.add_option("--server-username", dest="server_username", help="User name server uses for local auth. [default: foo]") - parser.add_option("--server-password", dest="server_password",\ + parser.add_option("--server-password", dest="server_password", help="Password server uses for local auth. [default: secret]") - parser.add_option("--server-domain", dest="server_domain",\ + parser.add_option("--server-domain", dest="server_domain", help="Domain server uses for local auth. [default: FOO]") - parser.add_option("--server-helper", dest="server_helper",\ + parser.add_option("--server-helper", dest="server_helper", help="Helper mode for the ntlm_auth server. [default: squid-2.5-server]") - parser.add_option("--server-use-winbindd", dest="server_use_winbindd",\ + parser.add_option("--server-use-winbindd", dest="server_use_winbindd", help="Use winbindd to check the password (rather than default username/pw)", action="store_true") - parser.add_option("--require-membership-of", dest="sid",\ + parser.add_option("--require-membership-of", dest="sid", help="Require that the user is a member of this group to authenticate.") - parser.add_option("-s", "--configfile", dest="config_file",\ + parser.add_option("-s", "--configfile", dest="config_file", help="Path to smb.conf file. [default:/etc/samba/smb.conf") (opts, args) = parser.parse_args() diff --git a/source4/dsdb/tests/python/acl.py b/source4/dsdb/tests/python/acl.py index 95e886f5013..3251cb53fa6 100755 --- a/source4/dsdb/tests/python/acl.py +++ b/source4/dsdb/tests/python/acl.py @@ -538,7 +538,7 @@ adminDescription: blah blah blah""" self.sd_utils.dacl_add_ace(self.get_user_dn(self.user_with_wp), mod) # Modify on attribute you have rights for self.ldb_user.modify_ldif(ldif) - res = self.ldb_admin.search(self.base_dn, expression="(distinguishedName=%s)" \ + res = self.ldb_admin.search(self.base_dn, expression="(distinguishedName=%s)" % self.get_user_dn(self.user_with_wp), attrs=["adminDescription"]) self.assertEqual(res[0]["adminDescription"][0], "blah blah blah") @@ -564,7 +564,7 @@ Member: """ + self.get_user_dn(self.user_with_sm) mod = "(OA;;SW;bf9679c0-0de6-11d0-a285-00aa003049e2;;%s)" % str(user_sid) self.sd_utils.dacl_add_ace("CN=test_modify_group2,CN=Users," + self.base_dn, mod) self.ldb_user2.modify_ldif(ldif) - res = self.ldb_admin.search(self.base_dn, expression="(distinguishedName=%s)" \ + res = self.ldb_admin.search(self.base_dn, expression="(distinguishedName=%s)" % ("CN=test_modify_group2,CN=Users," + self.base_dn), attrs=["Member"]) self.assertEqual(res[0]["Member"][0], self.get_user_dn(self.user_with_sm)) # but not other users @@ -614,7 +614,7 @@ changetype: modify add: Member Member: """ + self.get_user_dn(self.user_with_wp) self.ldb_user.modify_ldif(ldif) - res = self.ldb_admin.search(self.base_dn, expression="(distinguishedName=%s)" \ + res = self.ldb_admin.search(self.base_dn, expression="(distinguishedName=%s)" % ("CN=test_modify_group2,CN=Users," + self.base_dn), attrs=["Member"]) self.assertEqual(res[0]["Member"][0], self.get_user_dn(self.user_with_wp)) ldif = """ @@ -628,7 +628,7 @@ changetype: modify add: Member Member: CN=test_modify_user2,CN=Users,""" + self.base_dn self.ldb_user.modify_ldif(ldif) - res = self.ldb_admin.search(self.base_dn, expression="(distinguishedName=%s)" \ + res = self.ldb_admin.search(self.base_dn, expression="(distinguishedName=%s)" % ("CN=test_modify_group2,CN=Users," + self.base_dn), attrs=["Member"]) self.assertEqual(res[0]["Member"][0], "CN=test_modify_user2,CN=Users," + self.base_dn) @@ -685,7 +685,7 @@ class AclSearchTests(AclTests): def create_clean_ou(self, object_dn): """ Base repeating setup for unittests to follow """ - res = self.ldb_admin.search(base=self.base_dn, scope=SCOPE_SUBTREE, \ + res = self.ldb_admin.search(base=self.base_dn, scope=SCOPE_SUBTREE, expression="distinguishedName=%s" % object_dn) # Make sure top testing OU has been deleted before starting the test self.assertEqual(len(res), 0) @@ -1205,7 +1205,7 @@ class AclRenameTests(AclTests): self.ldb_admin.create_ou("OU=test_rename_ou1," + self.base_dn) self.ldb_admin.newuser(self.testuser1, self.user_pass, userou=self.ou1) try: - self.ldb_user.rename("CN=%s,%s,%s" % (self.testuser1, self.ou1, self.base_dn), \ + self.ldb_user.rename("CN=%s,%s,%s" % (self.testuser1, self.ou1, self.base_dn), "CN=%s,%s,%s" % (self.testuser5, self.ou1, self.base_dn)) except LdbError as e21: (num, _) = e21.args diff --git a/source4/dsdb/tests/python/deletetest.py b/source4/dsdb/tests/python/deletetest.py index 0c40e018968..af1274eb7f3 100755 --- a/source4/dsdb/tests/python/deletetest.py +++ b/source4/dsdb/tests/python/deletetest.py @@ -379,7 +379,7 @@ class BasicTreeDeleteTests(BasicDeleteTests): self.deleted_objects_domain_dn \ = self.ldb.get_wellknown_dn(self.ldb.get_default_basedn(), dsdb.DS_GUID_DELETED_OBJECTS_CONTAINER) - sites_obj = self.search_dn("cn=sites,%s" \ + sites_obj = self.search_dn("cn=sites,%s" % self.ldb.get_config_basedn()) self.sites_dn = sites_obj.dn self.sites_guid \ diff --git a/source4/dsdb/tests/python/sec_descriptor.py b/source4/dsdb/tests/python/sec_descriptor.py index 3fc99f73762..cea148fc88d 100755 --- a/source4/dsdb/tests/python/sec_descriptor.py +++ b/source4/dsdb/tests/python/sec_descriptor.py @@ -185,7 +185,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): delete_force(self.ldb_admin, "OU=test_domain_ou1," + self.base_dn) # SCHEMA # CONFIGURATION - delete_force(self.ldb_admin, "CN=test-specifier1,CN=test-container1,CN=DisplaySpecifiers," \ + delete_force(self.ldb_admin, "CN=test-specifier1,CN=test-container1,CN=DisplaySpecifiers," + self.configuration_dn) delete_force(self.ldb_admin, "CN=test-container1,CN=DisplaySpecifiers," + self.configuration_dn) @@ -1240,7 +1240,7 @@ class DaclDescriptorTests(DescriptorTests): def create_clean_ou(self, object_dn): """ Base repeating setup for unittests to follow """ - res = self.ldb_admin.search(base=self.base_dn, scope=SCOPE_SUBTREE, \ + res = self.ldb_admin.search(base=self.base_dn, scope=SCOPE_SUBTREE, expression="distinguishedName=%s" % object_dn) # Make sure top testing OU has been deleted before starting the test self.assertEqual(len(res), 0) @@ -2009,7 +2009,7 @@ class RightsAttributesTests(DescriptorTests): attrs=["sDRightsEffective"]) # user whould have DACL_SECURITY_INFORMATION, OWNER_SECURITY_INFORMATION, GROUP_SECURITY_INFORMATION self.assertEquals(len(res), 1) - self.assertEquals(res[0]["sDRightsEffective"][0], \ + self.assertEquals(res[0]["sDRightsEffective"][0], ("%d") % (SECINFO_DACL | SECINFO_GROUP | SECINFO_OWNER | SECINFO_SACL)) def test_allowedChildClassesEffective(self): diff --git a/source4/scripting/devel/repl_cleartext_pwd.py b/source4/scripting/devel/repl_cleartext_pwd.py index 4141cee1381..1da0417abc4 100755 --- a/source4/scripting/devel/repl_cleartext_pwd.py +++ b/source4/scripting/devel/repl_cleartext_pwd.py @@ -133,9 +133,9 @@ if __name__ == "__main__": f.close() store_hdr = store_blob[0:28] - (store_version, \ - store_dn_len, store_dn_ofs, \ - store_hwm_len, store_hwm_ofs, \ + (store_version, + store_dn_len, store_dn_ofs, + store_hwm_len, store_hwm_ofs, store_utdv_len, store_utdv_ofs) = \ struct.unpack("<LLLLLLL", store_hdr) @@ -395,9 +395,9 @@ if __name__ == "__main__": dn_ofs = store_hdr_len hwm_ofs = dn_ofs + len(dn) utdv_ofs = hwm_ofs + len(store_hwm_blob) - store_blob = struct.pack("<LLLLLLL", 1, \ + store_blob = struct.pack("<LLLLLLL", 1, len(dn), dn_ofs, - len(store_hwm_blob), hwm_ofs, \ + len(store_hwm_blob), hwm_ofs, len(store_utdv_blob), utdv_ofs) + \ dn + store_hwm_blob + store_utdv_blob diff --git a/source4/torture/drs/python/repl_move.py b/source4/torture/drs/python/repl_move.py index d5cb3ede4c2..9a64d465de8 100644 --- a/source4/torture/drs/python/repl_move.py +++ b/source4/torture/drs/python/repl_move.py @@ -176,9 +176,9 @@ class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase): (attid, orig_dsa, version) = e # Skip the RDN from the expected set, it is not sent over DRS - if (user_dn.get_rdn_name().upper() == "CN" \ + if (user_dn.get_rdn_name().upper() == "CN" and attid == DRSUAPI_ATTID_cn) \ - or (user_dn.get_rdn_name().upper() == "OU" \ + or (user_dn.get_rdn_name().upper() == "OU" and attid == DRSUAPI_ATTID_ou): i = i + 1 e = expected[i]; diff --git a/source4/torture/drs/python/repl_schema.py b/source4/torture/drs/python/repl_schema.py index 71095a07d73..dc570193f1c 100644 --- a/source4/torture/drs/python/repl_schema.py +++ b/source4/torture/drs/python/repl_schema.py @@ -121,7 +121,7 @@ class DrsReplSchemaTestCase(drs_base.DrsBaseTestCase): "objectClass": ["top", "classSchema"], "cn": class_name, "lDAPDisplayName": class_ldn, - "governsId": "1.3.6.1.4.1.7165.4.6.2.5." \ + "governsId": "1.3.6.1.4.1.7165.4.6.2.5." + str((100000 * base_int) + random.randint(1, 100000)) + ".1.5.13", "instanceType": "4", "objectClassCategory": "%d" % oc_cat, @@ -146,7 +146,7 @@ class DrsReplSchemaTestCase(drs_base.DrsBaseTestCase): "objectClass": ["top", "attributeSchema"], "cn": attr_name, "lDAPDisplayName": attr_ldn, - "attributeId": "1.3.6.1.4.1.7165.4.6.1.5." \ + "attributeId": "1.3.6.1.4.1.7165.4.6.1.5." + str((100000 * base_int) + random.randint(1, 100000)) + ".1.5.13", "attributeSyntax": "2.5.5.12", "omSyntax": "64", diff --git a/wintest/wintest.py b/wintest/wintest.py index e414d75dc5b..bf1b04d8774 100644 --- a/wintest/wintest.py +++ b/wintest/wintest.py @@ -939,9 +939,9 @@ RebootOnCompletion=No self.parser.add_option("--use-ntvfs", action='store_true', default=False, help='use NTVFS for the fileserver') self.parser.add_option("--dns-backend", type="choice", choices=["SAMBA_INTERNAL", "BIND9_FLATFILE", "BIND9_DLZ", "NONE"], - help="The DNS server backend. SAMBA_INTERNAL is the builtin name server (default), " \ - "BIND9_FLATFILE uses bind9 text database to store zone information, " \ - "BIND9_DLZ uses samba4 AD to store zone information, " \ + help="The DNS server backend. SAMBA_INTERNAL is the builtin name server (default), " + "BIND9_FLATFILE uses bind9 text database to store zone information, " + "BIND9_DLZ uses samba4 AD to store zone information, " "NONE skips the DNS setup entirely (not recommended)", default="SAMBA_INTERNAL") |