The branch, master has been updated via 8c2c979 PEP8: fix E128: continuation line under-indented for visual indent via deb8199 PEP8: fix E127: continuation line over-indented for visual indent via dc02a4c PEP8: fix E125: continuation line with same indent as next logical line via 7ff6c19 PEP8: fix E124: closing bracket does not match visual indentation via 8678fde PEP8: fix E123: closing bracket does not match indentation of opening bracket's line via 24fe850 PEP8: fix E122: continuation line missing indentation or outdented via 0f67b6e PEP8: fix E111: indentation is not a multiple of four via d02ec9f PEP8: fix E101: indentation contains mixed spaces and tabs via 23b3c5b PEP8: fix comment indent via bc188dd PEP8: ignore rules and exclude files from c4c6ca5 wafsamba: Support clang as C compiler
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 8c2c9794ec02eeb9eeecaa6dcd9e96dca3a9ac66 Author: Joe Guo <j...@catalyst.net.nz> Date: Tue Sep 4 01:05:52 2018 +1200 PEP8: fix E128: continuation line under-indented for visual indent Signed-off-by: Joe Guo <j...@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> Autobuild-User(master): Andrew Bartlett <abart...@samba.org> Autobuild-Date(master): Thu Sep 6 15:50:17 CEST 2018 on sn-devel-144 commit deb819913d1749563ba2e0ebb53aa788fc0388ea Author: Joe Guo <j...@catalyst.net.nz> Date: Tue Sep 4 01:05:48 2018 +1200 PEP8: fix E127: continuation line over-indented for visual indent Signed-off-by: Joe Guo <j...@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit dc02a4c35fbc92df0d8797eca4135ed22b14db29 Author: Joe Guo <j...@catalyst.net.nz> Date: Tue Sep 4 01:05:32 2018 +1200 PEP8: fix E125: continuation line with same indent as next logical line Signed-off-by: Joe Guo <j...@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 7ff6c198776e904aea5e9aa60d6aa26335c0f6ab Author: Joe Guo <j...@catalyst.net.nz> Date: Tue Sep 4 01:05:31 2018 +1200 PEP8: fix E124: closing bracket does not match visual indentation Signed-off-by: Joe Guo <j...@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 8678fde5821b524578dab0fa7db097b9e5148af2 Author: Joe Guo <j...@catalyst.net.nz> Date: Tue Sep 4 01:05:31 2018 +1200 PEP8: fix E123: closing bracket does not match indentation of opening bracket's line Signed-off-by: Joe Guo <j...@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 24fe85041f053dd6f835a3a99afa7169a8cc0654 Author: Joe Guo <j...@catalyst.net.nz> Date: Tue Sep 4 01:05:26 2018 +1200 PEP8: fix E122: continuation line missing indentation or outdented Signed-off-by: Joe Guo <j...@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 0f67b6e4b90d54fb75e078972baf392fca643056 Author: Joe Guo <j...@catalyst.net.nz> Date: Tue Sep 4 01:05:20 2018 +1200 PEP8: fix E111: indentation is not a multiple of four Signed-off-by: Joe Guo <j...@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit d02ec9f2ad90f3d4eae041e078cc228730b3d34f Author: Joe Guo <j...@catalyst.net.nz> Date: Tue Sep 4 01:05:20 2018 +1200 PEP8: fix E101: indentation contains mixed spaces and tabs Signed-off-by: Joe Guo <j...@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 23b3c5b65b57f1c0b671b0617831c94dd674809d Author: Joe Guo <j...@catalyst.net.nz> Date: Tue Sep 4 00:19:42 2018 +1200 PEP8: fix comment indent The comments in this file will make different PEP8 rules fight. Signed-off-by: Joe Guo <j...@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit bc188dd7a9fed4eb57a8259c56ca4de2d9a687f1 Author: Joe Guo <j...@catalyst.net.nz> Date: Mon Aug 27 16:48:59 2018 +1200 PEP8: ignore rules and exclude files Will fix other ones and come back to these later. Signed-off-by: Joe Guo <j...@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abart...@samba.org> ----------------------------------------------------------------------- Summary of changes: lib/ldb/tests/python/api.py | 2 +- python/samba/compat.py | 44 +-- python/samba/dbchecker.py | 4 +- python/samba/gp_sec_ext.py | 22 +- python/samba/join.py | 16 +- python/samba/netcmd/dns.py | 24 +- python/samba/netcmd/domain.py | 12 +- python/samba/netcmd/domain_backup.py | 4 +- python/samba/netcmd/fsmo.py | 4 +- python/samba/netcmd/gpo.py | 18 +- python/samba/netcmd/group.py | 2 +- python/samba/netcmd/ldapcmp.py | 8 +- python/samba/netcmd/schema.py | 4 +- python/samba/netcmd/user.py | 2 +- python/samba/provision/__init__.py | 34 +- python/samba/provision/backend.py | 22 +- python/samba/remove_dc.py | 2 +- python/samba/schema.py | 18 +- python/samba/tests/dcerpc/raw_protocol.py | 2 +- python/samba/tests/dckeytab.py | 4 +- python/samba/tests/posixacl.py | 251 ++++++++------- python/samba/tests/samba3sam.py | 2 +- python/samba/tests/samba_tool/gpo.py | 28 +- python/samba/tests/samba_tool/group.py | 8 +- python/samba/tests/samba_tool/ntacl.py | 20 +- python/samba/tests/samba_tool/user.py | 18 +- python/samba/tests/upgradeprovisionneeddc.py | 4 +- setup.cfg | 10 +- source3/script/tests/getset_quota.py | 216 ++++++------- source3/script/tests/test_smbcquota.py | 346 ++++++++++----------- source3/selftest/tests.py | 30 +- .../samdb/ldb_modules/tests/possibleinferiors.py | 4 +- source4/dsdb/tests/python/acl.py | 16 +- source4/dsdb/tests/python/confidential_attr.py | 2 +- source4/dsdb/tests/python/ldap.py | 14 +- source4/dsdb/tests/python/ldap_schema.py | 2 +- source4/dsdb/tests/python/rodc_rwdc.py | 2 +- source4/dsdb/tests/python/sort.py | 2 +- source4/dsdb/tests/python/token_group.py | 8 +- source4/dsdb/tests/python/vlv.py | 18 +- source4/scripting/devel/repl_cleartext_pwd.py | 4 +- source4/torture/drs/python/cracknames.py | 2 +- source4/torture/drs/python/drs_base.py | 4 +- source4/torture/drs/python/getnc_exop.py | 2 +- source4/torture/drs/python/repl_rodc.py | 8 +- wintest/test-s4-howto.py | 108 +++---- 46 files changed, 688 insertions(+), 689 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/ldb/tests/python/api.py b/lib/ldb/tests/python/api.py index e304bb2..37e8f4d 100755 --- a/lib/ldb/tests/python/api.py +++ b/lib/ldb/tests/python/api.py @@ -1327,7 +1327,7 @@ class SearchTests(LdbBaseTest): try: res11 = self.l.search(base="DC=SAMBA,DCXXXX", - scope=ldb.SCOPE_ONELEVEL) + scope=ldb.SCOPE_ONELEVEL) self.fail("Should have failed with ERR_INVALID_DN_SYNTAX") except ldb.LdbError as err: enum = err.args[0] diff --git a/python/samba/compat.py b/python/samba/compat.py index e151d9e..54f5bce 100644 --- a/python/samba/compat.py +++ b/python/samba/compat.py @@ -37,12 +37,12 @@ if PY3: # the PY2 code runs unchanged in PY2 whereas the code in PY3 possibly # encodes the variable (see PY2 implementation of this function below) def get_bytes(bytesorstring): - tmp = bytesorstring - if isinstance(bytesorstring, str): - tmp = bytesorstring.encode('utf8') - elif not isinstance(bytesorstring, bytes): - raise ValueError('Expected byte or string for %s:%s' % (type(bytesorstring), bytesorstring)) - return tmp + tmp = bytesorstring + if isinstance(bytesorstring, str): + tmp = bytesorstring.encode('utf8') + elif not isinstance(bytesorstring, bytes): + raise ValueError('Expected byte or string for %s:%s' % (type(bytesorstring), bytesorstring)) + return tmp # helper function to get a string from a variable that maybe 'str' or # 'bytes' if 'bytes' then it is decoded using 'utf8'. If 'str' is passed @@ -51,12 +51,12 @@ if PY3: # the PY2 code runs unchanged in PY2 whereas the code in PY3 possibly # decodes the variable (see PY2 implementation of this function below) def get_string(bytesorstring): - tmp = bytesorstring - if isinstance(bytesorstring, bytes): - tmp = bytesorstring.decode('utf8') - elif not isinstance(bytesorstring, str): - raise ValueError('Expected byte of string for %s:%s' % (type(bytesorstring), bytesorstring)) - return tmp + tmp = bytesorstring + if isinstance(bytesorstring, bytes): + tmp = bytesorstring.decode('utf8') + elif not isinstance(bytesorstring, str): + raise ValueError('Expected byte of string for %s:%s' % (type(bytesorstring), bytesorstring)) + return tmp def cmp_fn(x, y): """ @@ -90,12 +90,12 @@ else: # the PY2 code runs unchanged in PY2 whereas the code in PY3 possibly # encodes the variable (see PY3 implementation of this function above) def get_bytes(bytesorstring): - tmp = bytesorstring - if isinstance(bytesorstring, unicode): - tmp = bytesorstring.encode('utf8') - elif not isinstance(bytesorstring, str): - raise ValueError('Expected string for %s:%s' % (type(bytesorstring), bytesorstring)) - return tmp + tmp = bytesorstring + if isinstance(bytesorstring, unicode): + tmp = bytesorstring.encode('utf8') + elif not isinstance(bytesorstring, str): + raise ValueError('Expected string for %s:%s' % (type(bytesorstring), bytesorstring)) + return tmp # Helper function to return string. # if 'str' or 'unicode' passed in they are returned unchanged @@ -104,10 +104,10 @@ else: # the PY2 code runs unchanged in PY2 whereas the code in PY3 possibly # decodes the variable (see PY3 implementation of this function above) def get_string(bytesorstring): - tmp = bytesorstring - if not(isinstance(bytesorstring, str) or isinstance(bytesorstring, unicode)): - raise ValueError('Expected str or unicode for %s:%s' % (type(bytesorstring), bytesorstring)) - return tmp + tmp = bytesorstring + if not(isinstance(bytesorstring, str) or isinstance(bytesorstring, unicode)): + raise ValueError('Expected str or unicode for %s:%s' % (type(bytesorstring), bytesorstring)) + return tmp if sys.version_info < (2, 7): diff --git a/python/samba/dbchecker.py b/python/samba/dbchecker.py index beb664d..985ece30 100644 --- a/python/samba/dbchecker.py +++ b/python/samba/dbchecker.py @@ -1453,7 +1453,7 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base))) dn = ldb.Dn(self.samdb, "<GUID=%s>" % guid_str) res = self.samdb.search(base=dn, scope=ldb.SCOPE_BASE, attrs=[attr], controls=["search_options:1:2", - "show_recycled:1"]) + "show_recycled:1"]) msg = res[0] nmsg = ldb.Message() nmsg.dn = dn @@ -2215,7 +2215,7 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base))) set_attrs_seen.add(str(attrname).lower()) if syntax_oid in [dsdb.DSDB_SYNTAX_BINARY_DN, dsdb.DSDB_SYNTAX_OR_NAME, - dsdb.DSDB_SYNTAX_STRING_DN, ldb.SYNTAX_DN]: + dsdb.DSDB_SYNTAX_STRING_DN, ldb.SYNTAX_DN]: # it's some form of DN, do specialised checking on those error_count += self.check_dn(obj, attrname, syntax_oid) else: diff --git a/python/samba/gp_sec_ext.py b/python/samba/gp_sec_ext.py index 439d016..772f678 100644 --- a/python/samba/gp_sec_ext.py +++ b/python/samba/gp_sec_ext.py @@ -39,11 +39,11 @@ class inf_to_kdc_tdb(gp_ext_setter): def mapper(self): return {'kdc:user_ticket_lifetime': (self.set_kdc_tdb, self.explicit), - 'kdc:service_ticket_lifetime': (self.set_kdc_tdb, - self.mins_to_hours), - 'kdc:renewal_lifetime': (self.set_kdc_tdb, - self.days_to_hours), - } + 'kdc:service_ticket_lifetime': (self.set_kdc_tdb, + self.mins_to_hours), + 'kdc:renewal_lifetime': (self.set_kdc_tdb, + self.days_to_hours), + } def __str__(self): return 'Kerberos Policy' @@ -96,13 +96,13 @@ class inf_to_ldb(gp_ext_setter): def mapper(self): '''ldap value : samba setter''' return {"minPwdAge": (self.ch_minPwdAge, self.days2rel_nttime), - "maxPwdAge": (self.ch_maxPwdAge, self.days2rel_nttime), - # Could be none, but I like the method assignment in - # update_samba - "minPwdLength": (self.ch_minPwdLength, self.explicit), - "pwdProperties": (self.ch_pwdProperties, self.explicit), + "maxPwdAge": (self.ch_maxPwdAge, self.days2rel_nttime), + # Could be none, but I like the method assignment in + # update_samba + "minPwdLength": (self.ch_minPwdLength, self.explicit), + "pwdProperties": (self.ch_pwdProperties, self.explicit), - } + } def __str__(self): return 'System Access' diff --git a/python/samba/join.py b/python/samba/join.py index e7963eea..f111dcc 100644 --- a/python/samba/join.py +++ b/python/samba/join.py @@ -147,8 +147,8 @@ class DCJoinContext(object): ctx.topology_dn = None ctx.SPNs = ["HOST/%s" % ctx.myname, - "HOST/%s" % ctx.dnshostname, - "GC/%s/%s" % (ctx.dnshostname, ctx.dnsforest)] + "HOST/%s" % ctx.dnshostname, + "GC/%s/%s" % (ctx.dnshostname, ctx.dnsforest)] res_rid_manager = ctx.samdb.search(scope=ldb.SCOPE_BASE, attrs=["rIDManagerReference"], @@ -417,7 +417,7 @@ class DCJoinContext(object): "dn": ctx.krbtgt_dn, "objectclass": "user", "useraccountcontrol": str(samba.dsdb.UF_NORMAL_ACCOUNT | - samba.dsdb.UF_ACCOUNTDISABLE), + samba.dsdb.UF_ACCOUNTDISABLE), "showinadvancedviewonly": "TRUE", "description": "krbtgt for %s" % ctx.samname} ctx.samdb.add(rec, ["rodc_join:1:1"]) @@ -632,8 +632,8 @@ class DCJoinContext(object): "objectclass": "server", # windows uses 50000000 decimal for systemFlags. A windows hex/decimal mixup bug? "systemFlags": str(samba.dsdb.SYSTEM_FLAG_CONFIG_ALLOW_RENAME | - samba.dsdb.SYSTEM_FLAG_CONFIG_ALLOW_LIMITED_MOVE | - samba.dsdb.SYSTEM_FLAG_DISALLOW_MOVE_ON_DELETE), + samba.dsdb.SYSTEM_FLAG_CONFIG_ALLOW_LIMITED_MOVE | + samba.dsdb.SYSTEM_FLAG_DISALLOW_MOVE_ON_DELETE), # windows seems to add the dnsHostName later "dnsHostName": ctx.dnshostname} @@ -1045,7 +1045,7 @@ class DCJoinContext(object): client_version = dnsserver.DNS_CLIENT_VERSION_LONGHORN record_type = dnsp.DNS_TYPE_A select_flags = dnsserver.DNS_RPC_VIEW_AUTHORITY_DATA |\ - dnsserver.DNS_RPC_VIEW_NO_CHILDREN + dnsserver.DNS_RPC_VIEW_NO_CHILDREN zone = ctx.dnsdomain msdcs_zone = "_msdcs.%s" % ctx.dnsforest @@ -1445,13 +1445,13 @@ def join_RODC(logger=None, server=None, creds=None, lp=None, site=None, netbios_ samba.dsdb.UF_PARTIAL_SECRETS_ACCOUNT) ctx.SPNs.extend(["RestrictedKrbHost/%s" % ctx.myname, - "RestrictedKrbHost/%s" % ctx.dnshostname]) + "RestrictedKrbHost/%s" % ctx.dnshostname]) ctx.connection_dn = "CN=RODC Connection (FRS),%s" % ctx.ntds_dn ctx.secure_channel_type = misc.SEC_CHAN_RODC ctx.RODC = True ctx.replica_flags |= (drsuapi.DRSUAPI_DRS_SPECIAL_SECRET_PROCESSING | - drsuapi.DRSUAPI_DRS_GET_ALL_GROUP_MEMBERSHIP) + drsuapi.DRSUAPI_DRS_GET_ALL_GROUP_MEMBERSHIP) ctx.domain_replica_flags = ctx.replica_flags if domain_critical_only: ctx.domain_replica_flags |= drsuapi.DRSUAPI_DRS_CRITICAL_ONLY diff --git a/python/samba/netcmd/dns.py b/python/samba/netcmd/dns.py index 63ab346..783a1d5 100644 --- a/python/samba/netcmd/dns.py +++ b/python/samba/netcmd/dns.py @@ -87,53 +87,53 @@ def bitmap_string(module, bitmap_defs, value): def boot_method_string(boot_method): enum_defs = ['DNS_BOOT_METHOD_UNINITIALIZED', 'DNS_BOOT_METHOD_FILE', - 'DNS_BOOT_METHOD_REGISTRY', 'DNS_BOOT_METHOD_DIRECTORY'] + 'DNS_BOOT_METHOD_REGISTRY', 'DNS_BOOT_METHOD_DIRECTORY'] return enum_string(dnsserver, enum_defs, boot_method) def name_check_flag_string(check_flag): enum_defs = ['DNS_ALLOW_RFC_NAMES_ONLY', 'DNS_ALLOW_NONRFC_NAMES', - 'DNS_ALLOW_MULTIBYTE_NAMES', 'DNS_ALLOW_ALL_NAMES'] + 'DNS_ALLOW_MULTIBYTE_NAMES', 'DNS_ALLOW_ALL_NAMES'] return enum_string(dnsserver, enum_defs, check_flag) def zone_type_string(zone_type): enum_defs = ['DNS_ZONE_TYPE_CACHE', 'DNS_ZONE_TYPE_PRIMARY', - 'DNS_ZONE_TYPE_SECONDARY', 'DNS_ZONE_TYPE_STUB', - 'DNS_ZONE_TYPE_FORWARDER', 'DNS_ZONE_TYPE_SECONDARY_CACHE'] + 'DNS_ZONE_TYPE_SECONDARY', 'DNS_ZONE_TYPE_STUB', + 'DNS_ZONE_TYPE_FORWARDER', 'DNS_ZONE_TYPE_SECONDARY_CACHE'] return enum_string(dnsp, enum_defs, zone_type) def zone_update_string(zone_update): enum_defs = ['DNS_ZONE_UPDATE_OFF', 'DNS_ZONE_UPDATE_UNSECURE', - 'DNS_ZONE_UPDATE_SECURE'] + 'DNS_ZONE_UPDATE_SECURE'] return enum_string(dnsp, enum_defs, zone_update) def zone_secondary_security_string(security): enum_defs = ['DNS_ZONE_SECSECURE_NO_SECURITY', 'DNS_ZONE_SECSECURE_NS_ONLY', - 'DNS_ZONE_SECSECURE_LIST_ONLY', 'DNS_ZONE_SECSECURE_NO_XFER'] + 'DNS_ZONE_SECSECURE_LIST_ONLY', 'DNS_ZONE_SECSECURE_NO_XFER'] return enum_string(dnsserver, enum_defs, security) def zone_notify_level_string(notify_level): enum_defs = ['DNS_ZONE_NOTIFY_OFF', 'DNS_ZONE_NOTIFY_ALL_SECONDARIES', - 'DNS_ZONE_NOTIFY_LIST_ONLY'] + 'DNS_ZONE_NOTIFY_LIST_ONLY'] return enum_string(dnsserver, enum_defs, notify_level) def dp_flags_string(dp_flags): bitmap_defs = ['DNS_DP_AUTOCREATED', 'DNS_DP_LEGACY', 'DNS_DP_DOMAIN_DEFAULT', - 'DNS_DP_FOREST_DEFAULT', 'DNS_DP_ENLISTED', 'DNS_DP_DELETED'] + 'DNS_DP_FOREST_DEFAULT', 'DNS_DP_ENLISTED', 'DNS_DP_DELETED'] return bitmap_string(dnsserver, bitmap_defs, dp_flags) def zone_flags_string(flags): bitmap_defs = ['DNS_RPC_ZONE_PAUSED', 'DNS_RPC_ZONE_SHUTDOWN', - 'DNS_RPC_ZONE_REVERSE', 'DNS_RPC_ZONE_AUTOCREATED', - 'DNS_RPC_ZONE_DSINTEGRATED', 'DNS_RPC_ZONE_AGING', - 'DNS_RPC_ZONE_UPDATE_UNSECURE', 'DNS_RPC_ZONE_UPDATE_SECURE', - 'DNS_RPC_ZONE_READONLY'] + 'DNS_RPC_ZONE_REVERSE', 'DNS_RPC_ZONE_AUTOCREATED', + 'DNS_RPC_ZONE_DSINTEGRATED', 'DNS_RPC_ZONE_AGING', + 'DNS_RPC_ZONE_UPDATE_UNSECURE', 'DNS_RPC_ZONE_UPDATE_SECURE', + 'DNS_RPC_ZONE_READONLY'] return bitmap_string(dnsserver, bitmap_defs, flags) diff --git a/python/samba/netcmd/domain.py b/python/samba/netcmd/domain.py index 56386c5..e90266d 100644 --- a/python/samba/netcmd/domain.py +++ b/python/samba/netcmd/domain.py @@ -1066,7 +1066,7 @@ class cmd_domain_level(Command): help="The forest function level (2003 | 2008 | 2008_R2 | 2012 | 2012_R2)"), Option("--domain-level", type="choice", choices=["2003", "2008", "2008_R2", "2012", "2012_R2"], help="The domain function level (2003 | 2008 | 2008_R2 | 2012 | 2012_R2)") - ] + ] takes_args = ["subcommand"] @@ -1389,7 +1389,7 @@ class cmd_domain_passwordsettings_set(Command): help="The number of bad password attempts allowed before locking out the account (<integer> | default). Default is 0 (never lock out).", type=str), Option("--reset-account-lockout-after", help="After this time is elapsed, the recorded number of attempts restarts from zero (<integer> | default). Default is 30.", type=str), - ] + ] def run(self, H=None, min_pwd_age=None, max_pwd_age=None, quiet=False, complexity=None, store_plaintext=None, history_length=None, @@ -2487,7 +2487,7 @@ class cmd_domain_trust_create(DomainTrustCommand): if not self.check_runtime_error(error, ntstatus.NT_STATUS_OBJECT_NAME_NOT_FOUND): raise self.LocalRuntimeError(self, error, "QueryTrustedDomainInfoByName(%s, FULL_INFO) failed" % ( - lsaString.string)) + lsaString.string)) try: lsaString.string = local_trust_info.netbios_name.string @@ -2500,7 +2500,7 @@ class cmd_domain_trust_create(DomainTrustCommand): if not self.check_runtime_error(error, ntstatus.NT_STATUS_OBJECT_NAME_NOT_FOUND): raise self.LocalRuntimeError(self, error, "QueryTrustedDomainInfoByName(%s, FULL_INFO) failed" % ( - lsaString.string)) + lsaString.string)) if remote_trust_info: try: @@ -2514,7 +2514,7 @@ class cmd_domain_trust_create(DomainTrustCommand): if not self.check_runtime_error(error, ntstatus.NT_STATUS_OBJECT_NAME_NOT_FOUND): raise self.RemoteRuntimeError(self, error, "QueryTrustedDomainInfoByName(%s, FULL_INFO) failed" % ( - lsaString.string)) + lsaString.string)) try: lsaString.string = remote_trust_info.netbios_name.string @@ -2527,7 +2527,7 @@ class cmd_domain_trust_create(DomainTrustCommand): if not self.check_runtime_error(error, ntstatus.NT_STATUS_OBJECT_NAME_NOT_FOUND): raise self.RemoteRuntimeError(self, error, "QueryTrustedDomainInfoByName(%s, FULL_INFO) failed" % ( - lsaString.string)) + lsaString.string)) try: local_netlogon = self.new_local_netlogon_connection() diff --git a/python/samba/netcmd/domain_backup.py b/python/samba/netcmd/domain_backup.py index de53c6e..bff2bdd 100644 --- a/python/samba/netcmd/domain_backup.py +++ b/python/samba/netcmd/domain_backup.py @@ -208,7 +208,7 @@ class cmd_domain_backup_online(samba.netcmd.Command): help="Directory to write the backup file to"), Option("--no-secrets", action="store_true", default=False, help="Exclude secret values from the backup created") - ] + ] def run(self, sambaopts=None, credopts=None, server=None, targetdir=None, no_secrets=False): @@ -585,7 +585,7 @@ class cmd_domain_backup_rename(samba.netcmd.Command): help="Retain the DNS entries for the old realm in the backup"), Option("--no-secrets", action="store_true", default=False, help="Exclude secret values from the backup created") - ] + ] takes_args = ["new_domain_name", "new_dns_realm"] diff --git a/python/samba/netcmd/fsmo.py b/python/samba/netcmd/fsmo.py index 0c4ee7a..b916f9c 100644 --- a/python/samba/netcmd/fsmo.py +++ b/python/samba/netcmd/fsmo.py @@ -120,8 +120,8 @@ def transfer_dns_role(outf, sambaopts, credopts, role, samdb): m = ldb.Message() m.dn = ldb.Dn(samdb, role_object) m["fSMORoleOwner"] = ldb.MessageElement(new_owner, - ldb.FLAG_MOD_ADD, - "fSMORoleOwner") + ldb.FLAG_MOD_ADD, + "fSMORoleOwner") try: samdb.modify(m) except LdbError as e5: diff --git a/python/samba/netcmd/gpo.py b/python/samba/netcmd/gpo.py index d0b94ff..6a7efe8 100644 --- a/python/samba/netcmd/gpo.py +++ b/python/samba/netcmd/gpo.py @@ -449,7 +449,7 @@ class cmd_list(Command): raise CommandError("Failed to find objectClass for user %s" % username) session_info_flags = (AUTH_SESSION_INFO_DEFAULT_GROUPS | - AUTH_SESSION_INFO_AUTHENTICATED) + AUTH_SESSION_INFO_AUTHENTICATED) # When connecting to a remote server, don't look up the local privilege DB if self.url is not None and self.url.startswith('ldap'): @@ -980,7 +980,7 @@ class cmd_backup(Command): default=False, action='store_true'), Option("--entities", help="File to export defining XML entities for the restore", dest='ent_file', type=str) - ] + ] def run(self, gpo, H=None, tmpdir=None, generalize=False, sambaopts=None, credopts=None, versionopts=None, ent_file=None): @@ -1225,8 +1225,8 @@ class cmd_create(Command): # Get new security descriptor ds_sd_flags = (security.SECINFO_OWNER | - security.SECINFO_GROUP | - security.SECINFO_DACL) + security.SECINFO_GROUP | + security.SECINFO_DACL) msg = get_gpo_info(self.samdb, gpo=gpo, sd_flags=ds_sd_flags)[0] ds_sd_ndr = msg['nTSecurityDescriptor'][0] ds_sd = ndr_unpack(security.descriptor, ds_sd_ndr).as_sddl() @@ -1241,9 +1241,9 @@ class cmd_create(Command): # Set ACL sio = (security.SECINFO_OWNER | - security.SECINFO_GROUP | - security.SECINFO_DACL | - security.SECINFO_PROTECTED_DACL) + security.SECINFO_GROUP | + security.SECINFO_DACL | + security.SECINFO_PROTECTED_DACL) conn.set_acl(sharepath, fs_sd, sio) # Copy GPO files over SMB @@ -1284,7 +1284,7 @@ class cmd_restore(cmd_create): Option("-H", help="LDB URL for database or target server", type=str), Option("--tmpdir", help="Temporary directory for copying policy files", type=str), Option("--entities", help="File defining XML entities to insert into DOCTYPE header", type=str) - ] + ] def restore_from_backup_to_local_dir(self, sourcedir, targetdir, dtd_header=''): SUFFIX = '.SAMBABACKUP' @@ -1385,7 +1385,7 @@ class cmd_restore(cmd_create): dtd_header += '\n]>\n' super(cmd_restore, self).run(displayname, H, tmpdir, sambaopts, - credopts, versionopts) + credopts, versionopts) try: # Iterate over backup files and restore with DTD diff --git a/python/samba/netcmd/group.py b/python/samba/netcmd/group.py index bbeab76..5158357 100644 --- a/python/samba/netcmd/group.py +++ b/python/samba/netcmd/group.py @@ -568,7 +568,7 @@ Example3 shows how to display a users objectGUID and member attributes. filter = ("(&(sAMAccountType=%d)(sAMAccountName=%s))" % (ATYPE_SECURITY_GLOBAL_GROUP, - ldb.binary_encode(groupname))) + ldb.binary_encode(groupname))) domaindn = samdb.domain_dn() diff --git a/python/samba/netcmd/ldapcmp.py b/python/samba/netcmd/ldapcmp.py index 5f92745..231aaa1 100644 --- a/python/samba/netcmd/ldapcmp.py +++ b/python/samba/netcmd/ldapcmp.py @@ -500,8 +500,8 @@ class LDAPObject(object): # # May contain DOMAIN_NETBIOS and SERVER_NAME self.servername_attributes = ["distinguishedName", "name", "CN", "sAMAccountName", "dNSHostName", - "servicePrincipalName", "rIDSetReferences", "serverReference", "serverReferenceBL", - "msDS-IsDomainFor", "interSiteTopologyGenerator", ] + "servicePrincipalName", "rIDSetReferences", "serverReference", "serverReferenceBL", + "msDS-IsDomainFor", "interSiteTopologyGenerator", ] self.servername_attributes = [x.upper() for x in self.servername_attributes] # self.netbios_attributes = ["servicePrincipalName", "CN", "distinguishedName", "nETBIOSName", "name", ] @@ -581,7 +581,7 @@ class LDAPObject(object): title = 4 * " " + "Attributes found only in %s:" % self.con.host for x in self.attributes.keys(): if x not in other.attributes.keys() and \ - not x.upper() in [q.upper() for q in other.ignore_attributes]: + not x.upper() in [q.upper() for q in other.ignore_attributes]: if title: res += title + "\n" title = None @@ -591,7 +591,7 @@ class LDAPObject(object): title = 4 * " " + "Attributes found only in %s:" % other.con.host for x in other.attributes.keys(): if x not in self.attributes.keys() and \ - not x.upper() in [q.upper() for q in self.ignore_attributes]: + not x.upper() in [q.upper() for q in self.ignore_attributes]: if title: res += title + "\n" title = None diff --git a/python/samba/netcmd/schema.py b/python/samba/netcmd/schema.py index 5768169..889dd3f 100644 --- a/python/samba/netcmd/schema.py +++ b/python/samba/netcmd/schema.py @@ -237,9 +237,9 @@ class cmd_schema_attribute_show_oc(Command): schema_dn = samdb.schema_dn() may_filt = '(&(objectClass=classSchema)' \ - '(|(mayContain={0})(systemMayContain={0})))'.format(attribute) + '(|(mayContain={0})(systemMayContain={0})))'.format(attribute) must_filt = '(&(objectClass=classSchema)' \ - '(|(mustContain={0})(systemMustContain={0})))'.format(attribute) + '(|(mustContain={0})(systemMustContain={0})))'.format(attribute) -- Samba Shared Repository