Skip to content

Commit

Permalink
PEP8: fix E202: whitespace before ')'
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 a9551ed commit 562411b
Show file tree
Hide file tree
Showing 47 changed files with 254 additions and 254 deletions.
16 changes: 8 additions & 8 deletions lib/ldb-samba/tests/match_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,16 @@ def setUp(self):
# Add four groups
self.ldb.add({
"dn": "cn=g1,%s" % self.ou_groups,
"objectclass": "group" })
"objectclass": "group"})
self.ldb.add({
"dn": "cn=g2,%s" % self.ou_groups,
"objectclass": "group" })
"objectclass": "group"})
self.ldb.add({
"dn": "cn=g4,%s" % self.ou_groups,
"objectclass": "group" })
"objectclass": "group"})
self.ldb.add({
"dn": "cn=g3,%s" % self.ou_groups,
"objectclass": "group" })
"objectclass": "group"})

# Add four users
self.ldb.add({
Expand Down Expand Up @@ -972,16 +972,16 @@ def setUp(self):

self.ldb.add({
"dn": "cn=g1,%s" % self.ou_groups,
"objectclass": "group" })
"objectclass": "group"})
self.ldb.add({
"dn": "cn=g2,%s" % self.ou_groups,
"objectclass": "group" })
"objectclass": "group"})
self.ldb.add({
"dn": "cn=g3,%s" % self.ou_groups,
"objectclass": "group" })
"objectclass": "group"})
self.ldb.add({
"dn": "cn=g4,%s" % self.ou_groups,
"objectclass": "group" })
"objectclass": "group"})

self.ldb.add({
"dn": "cn=u1,%s" % self.ou_users,
Expand Down
2 changes: 1 addition & 1 deletion python/samba/dbchecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2225,7 +2225,7 @@ def check_object(self, dn, attrs=['*']):
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:
Expand Down
10 changes: 5 additions & 5 deletions python/samba/join.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def __init__(ctx, logger=None, server=None, creds=None, lp=None, site=None,

ctx.SPNs = ["HOST/%s" % ctx.myname,
"HOST/%s" % ctx.dnshostname,
"GC/%s/%s" % (ctx.dnshostname, ctx.dnsforest) ]
"GC/%s/%s" % (ctx.dnshostname, ctx.dnsforest)]

res_rid_manager = ctx.samdb.search(scope=ldb.SCOPE_BASE,
attrs=["rIDManagerReference"],
Expand Down Expand Up @@ -541,7 +541,7 @@ def join_ntdsdsa_obj(ctx):
"systemFlags" : str(samba.dsdb.SYSTEM_FLAG_DISALLOW_MOVE_ON_DELETE),
"dMDLocation" : ctx.schema_dn}

nc_list = [ctx.base_dn, ctx.config_dn, ctx.schema_dn ]
nc_list = [ctx.base_dn, ctx.config_dn, ctx.schema_dn]

if ctx.behavior_version >= samba.dsdb.DS_DOMAIN_FUNCTION_2003:
rec["msDS-Behavior-Version"] = str(samba.dsdb.DS_DOMAIN_FUNCTION_2008_R2)
Expand Down Expand Up @@ -1369,8 +1369,8 @@ def build_nc_lists(ctx):

# full_nc_list is the list of naming context (NC) we hold
# read/write copies of. These are not subsets of each other.
ctx.nc_list = [ctx.config_dn, ctx.schema_dn ]
ctx.full_nc_list = [ctx.base_dn, ctx.config_dn, ctx.schema_dn ]
ctx.nc_list = [ctx.config_dn, ctx.schema_dn]
ctx.full_nc_list = [ctx.base_dn, ctx.config_dn, ctx.schema_dn]

if ctx.subdomain and ctx.dns_backend != "NONE":
ctx.full_nc_list += [ctx.domaindns_zone]
Expand Down Expand Up @@ -1453,7 +1453,7 @@ 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
Expand Down
2 changes: 1 addition & 1 deletion python/samba/netcmd/computer.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ class cmd_computer_move(Command):
type=str, metavar="URL", dest="H"),
]

takes_args = ["computername", "new_ou_dn" ]
takes_args = ["computername", "new_ou_dn"]
takes_optiongroups = {
"sambaopts": options.SambaOptions,
"credopts": options.CredentialsOptions,
Expand Down
2 changes: 1 addition & 1 deletion python/samba/netcmd/dbcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def run(self, DN=None, H=None, verbose=False, fix=False, yes=False,
samdb_schema = SamDB(session_info=system_session(), url=None,
credentials=creds, lp=lp)

scope_map = {"SUB": ldb.SCOPE_SUBTREE, "BASE": ldb.SCOPE_BASE, "ONE":ldb.SCOPE_ONELEVEL }
scope_map = {"SUB": ldb.SCOPE_SUBTREE, "BASE": ldb.SCOPE_BASE, "ONE":ldb.SCOPE_ONELEVEL}
scope = scope.upper()
if not scope in scope_map:
raise CommandError("Unknown scope %s" % scope)
Expand Down
34 changes: 17 additions & 17 deletions python/samba/netcmd/dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,44 +86,44 @@ 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_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)


Expand Down Expand Up @@ -538,7 +538,7 @@ class cmd_serverinfo(Command):

synopsis = '%prog <server> [options]'

takes_args = ['server' ]
takes_args = ['server']

takes_optiongroups = {
"sambaopts": options.SambaOptions,
Expand Down Expand Up @@ -570,7 +570,7 @@ class cmd_zoneinfo(Command):

synopsis = '%prog <server> <zone> [options]'

takes_args = ['server', 'zone' ]
takes_args = ['server', 'zone']

takes_optiongroups = {
"sambaopts": options.SambaOptions,
Expand Down Expand Up @@ -602,7 +602,7 @@ class cmd_zonelist(Command):

synopsis = '%prog <server> [options]'

takes_args = ['server' ]
takes_args = ['server']

takes_optiongroups = {
"sambaopts": options.SambaOptions,
Expand Down Expand Up @@ -681,7 +681,7 @@ class cmd_zonecreate(Command):

synopsis = '%prog <server> <zone> [options]'

takes_args = ['server', 'zone' ]
takes_args = ['server', 'zone']

takes_optiongroups = {
"sambaopts": options.SambaOptions,
Expand Down Expand Up @@ -758,7 +758,7 @@ class cmd_zonedelete(Command):

synopsis = '%prog <server> <zone> [options]'

takes_args = ['server', 'zone' ]
takes_args = ['server', 'zone']

takes_optiongroups = {
"sambaopts": options.SambaOptions,
Expand Down Expand Up @@ -792,7 +792,7 @@ class cmd_query(Command):

synopsis = '%prog <server> <zone> <name> <A|AAAA|CNAME|MX|NS|SOA|SRV|TXT|ALL> [options]'

takes_args = ['server', 'zone', 'name', 'rtype' ]
takes_args = ['server', 'zone', 'name', 'rtype']

takes_optiongroups = {
"sambaopts": options.SambaOptions,
Expand Down Expand Up @@ -872,7 +872,7 @@ class cmd_roothints(Command):

synopsis = '%prog <server> [<name>] [options]'

takes_args = ['server', 'name?' ]
takes_args = ['server', 'name?']

takes_optiongroups = {
"sambaopts": options.SambaOptions,
Expand Down Expand Up @@ -912,7 +912,7 @@ class cmd_add_record(Command):

synopsis = '%prog <server> <zone> <name> <A|AAAA|PTR|CNAME|NS|MX|SRV|TXT> <data>'

takes_args = ['server', 'zone', 'name', 'rtype', 'data' ]
takes_args = ['server', 'zone', 'name', 'rtype', 'data']

takes_optiongroups = {
"sambaopts": options.SambaOptions,
Expand Down Expand Up @@ -964,7 +964,7 @@ class cmd_update_record(Command):

synopsis = '%prog <server> <zone> <name> <A|AAAA|PTR|CNAME|NS|MX|SOA|SRV|TXT> <olddata> <newdata>'

takes_args = ['server', 'zone', 'name', 'rtype', 'olddata', 'newdata' ]
takes_args = ['server', 'zone', 'name', 'rtype', 'olddata', 'newdata']

takes_optiongroups = {
"sambaopts": options.SambaOptions,
Expand Down Expand Up @@ -1034,7 +1034,7 @@ class cmd_delete_record(Command):

synopsis = '%prog <server> <zone> <name> <A|AAAA|PTR|CNAME|NS|MX|SRV|TXT> <data>'

takes_args = ['server', 'zone', 'name', 'rtype', 'data' ]
takes_args = ['server', 'zone', 'name', 'rtype', 'data']

takes_optiongroups = {
"sambaopts": options.SambaOptions,
Expand Down
2 changes: 1 addition & 1 deletion python/samba/netcmd/drs.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ class cmd_drs_options(Command):

takes_options = [
Option("--dsa-option", help="DSA option to enable/disable", type="str",
metavar="{+|-}IS_GC | {+|-}DISABLE_INBOUND_REPL | {+|-}DISABLE_OUTBOUND_REPL | {+|-}DISABLE_NTDSCONN_XLATE" ),
metavar="{+|-}IS_GC | {+|-}DISABLE_INBOUND_REPL | {+|-}DISABLE_OUTBOUND_REPL | {+|-}DISABLE_NTDSCONN_XLATE"),
]

option_map = {"IS_GC": 0x00000001,
Expand Down
20 changes: 10 additions & 10 deletions python/samba/netcmd/gpo.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,8 @@ def backup_directory_remote_to_local(conn, remotedir, localdir):
def copy_directory_remote_to_local(conn, remotedir, localdir):
if not os.path.isdir(localdir):
os.mkdir(localdir)
r_dirs = [remotedir ]
l_dirs = [localdir ]
r_dirs = [remotedir]
l_dirs = [localdir]
while r_dirs:
r_dir = r_dirs.pop()
l_dir = l_dirs.pop()
Expand All @@ -333,8 +333,8 @@ def copy_directory_local_to_remote(conn, localdir, remotedir,
ignore_existing=False):
if not conn.chkpath(remotedir):
conn.mkdir(remotedir)
l_dirs = [localdir ]
r_dirs = [remotedir ]
l_dirs = [localdir]
r_dirs = [remotedir]
while l_dirs:
l_dir = l_dirs.pop()
r_dir = r_dirs.pop()
Expand Down Expand Up @@ -445,7 +445,7 @@ def run(self, username, H=None, sambaopts=None, credopts=None, versionopts=None)
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'):
Expand Down Expand Up @@ -680,10 +680,10 @@ def run(self, container_dn, gpo, H=None, disabled=False, enforced=False,
if found:
raise CommandError("GPO '%s' already linked to this container" % gpo)
else:
gplist.insert(0, {'dn' : gpo_dn, 'options' : gplink_options })
gplist.insert(0, {'dn' : gpo_dn, 'options' : gplink_options})
else:
gplist = []
gplist.append({'dn' : gpo_dn, 'options' : gplink_options })
gplist.append({'dn' : gpo_dn, 'options' : gplink_options})

gplink_str = encode_gplink(gplist)

Expand Down Expand Up @@ -834,7 +834,7 @@ class cmd_setinheritance(Command):
"credopts": options.CredentialsOptions,
}

takes_args = ['container_dn', 'inherit_state' ]
takes_args = ['container_dn', 'inherit_state']

takes_options = [
Option("-H", help="LDB URL for database or target server", type=str)
Expand Down Expand Up @@ -1220,7 +1220,7 @@ def run(self, displayname, H=None, tmpdir=None, sambaopts=None, credopts=None,
# Get new security descriptor
ds_sd_flags = (security.SECINFO_OWNER |
security.SECINFO_GROUP |
security.SECINFO_DACL )
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()
Expand All @@ -1237,7 +1237,7 @@ def run(self, displayname, H=None, tmpdir=None, sambaopts=None, credopts=None,
sio = (security.SECINFO_OWNER |
security.SECINFO_GROUP |
security.SECINFO_DACL |
security.SECINFO_PROTECTED_DACL )
security.SECINFO_PROTECTED_DACL)
conn.set_acl(sharepath, fs_sd, sio)

# Copy GPO files over SMB
Expand Down
2 changes: 1 addition & 1 deletion python/samba/netcmd/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ class cmd_group_move(Command):
type=str, metavar="URL", dest="H"),
]

takes_args = ["groupname", "new_parent_dn" ]
takes_args = ["groupname", "new_parent_dn"]
takes_optiongroups = {
"sambaopts": options.SambaOptions,
"credopts": options.CredentialsOptions,
Expand Down
Loading

0 comments on commit 562411b

Please sign in to comment.