1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-03 04:22:09 +03:00

PEP8: better formatting of (CONST1|CONST2)

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 17:06:23 +12:00
committed by Douglas Bagnall
parent 5d0dc38cfe
commit 333bc327c0
4 changed files with 14 additions and 5 deletions

View File

@ -326,7 +326,8 @@ class DCJoinContext(object):
raise Exception("Could not find domain member account '%s' to promote to a DC, use 'samba-tool domain join' instead'" % ctx.samname) raise Exception("Could not find domain member account '%s' to promote to a DC, use 'samba-tool domain join' instead'" % ctx.samname)
if "msDS-krbTgtLink" in res[0] or "serverReferenceBL" in res[0] or "rIDSetReferences" in res[0]: if "msDS-krbTgtLink" in res[0] or "serverReferenceBL" in res[0] or "rIDSetReferences" in res[0]:
raise Exception("Account '%s' appears to be an active DC, use 'samba-tool domain join' if you must re-create this account" % ctx.samname) raise Exception("Account '%s' appears to be an active DC, use 'samba-tool domain join' if you must re-create this account" % ctx.samname)
if (int(res[0]["userAccountControl"][0]) & (samba.dsdb.UF_WORKSTATION_TRUST_ACCOUNT |samba.dsdb.UF_SERVER_TRUST_ACCOUNT) == 0): if (int(res[0]["userAccountControl"][0]) & (samba.dsdb.UF_WORKSTATION_TRUST_ACCOUNT |
samba.dsdb.UF_SERVER_TRUST_ACCOUNT) == 0):
raise Exception("Account %s is not a domain member or a bare NT4 BDC, use 'samba-tool domain join' instead'" % ctx.samname) raise Exception("Account %s is not a domain member or a bare NT4 BDC, use 'samba-tool domain join' instead'" % ctx.samname)
ctx.promote_from_dn = res[0].dn ctx.promote_from_dn = res[0].dn

View File

@ -902,7 +902,9 @@ class cmd_domain_demote(Command):
olduac = uac olduac = uac
uac &= ~(UF_SERVER_TRUST_ACCOUNT |UF_TRUSTED_FOR_DELEGATION |UF_PARTIAL_SECRETS_ACCOUNT) uac &= ~(UF_SERVER_TRUST_ACCOUNT |
UF_TRUSTED_FOR_DELEGATION |
UF_PARTIAL_SECRETS_ACCOUNT)
uac |= UF_WORKSTATION_TRUST_ACCOUNT uac |= UF_WORKSTATION_TRUST_ACCOUNT
msg = ldb.Message() msg = ldb.Message()

View File

@ -144,7 +144,10 @@ def get_gpo_dn(samdb, gpo):
def get_gpo_info(samdb, gpo=None, displayname=None, dn=None, def get_gpo_info(samdb, gpo=None, displayname=None, dn=None,
sd_flags=security.SECINFO_OWNER |security.SECINFO_GROUP |security.SECINFO_DACL |security.SECINFO_SACL): sd_flags=(security.SECINFO_OWNER |
security.SECINFO_GROUP |
security.SECINFO_DACL |
security.SECINFO_SACL)):
'''Get GPO information using gpo, displayname or dn''' '''Get GPO information using gpo, displayname or dn'''
policies_dn = samdb.get_default_basedn() policies_dn = samdb.get_default_basedn()
@ -472,7 +475,9 @@ class cmd_list(Command):
continue continue
try: try:
sd_flags = security.SECINFO_OWNER |security.SECINFO_GROUP |security.SECINFO_DACL sd_flags = (security.SECINFO_OWNER |
security.SECINFO_GROUP |
security.SECINFO_DACL)
gmsg = self.samdb.search(base=g['dn'], scope=ldb.SCOPE_BASE, gmsg = self.samdb.search(base=g['dn'], scope=ldb.SCOPE_BASE,
attrs=['name', 'displayName', 'flags', attrs=['name', 'displayName', 'flags',
'nTSecurityDescriptor'], 'nTSecurityDescriptor'],

View File

@ -395,7 +395,8 @@ member: %s
"objectClass": "user"} "objectClass": "user"}
if smartcard_required: if smartcard_required:
ldbmessage["userAccountControl"] = str(dsdb.UF_NORMAL_ACCOUNT |dsdb.UF_SMARTCARD_REQUIRED) ldbmessage["userAccountControl"] = str(dsdb.UF_NORMAL_ACCOUNT |
dsdb.UF_SMARTCARD_REQUIRED)
setpassword = False setpassword = False
if surname is not None: if surname is not None: