Skip to content

Commit

Permalink
PEP8: fix E265: block comment should start with '# '
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 c809a86 commit 7a07d42
Show file tree
Hide file tree
Showing 32 changed files with 131 additions and 130 deletions.
2 changes: 1 addition & 1 deletion python/samba/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def __init__(self, url=None, lp=None, modules_dir=None, session_info=None,
# TODO set debug
def msg(l, text):
print(text)
#self.set_debug(msg)
# self.set_debug(msg)

self.set_utf8_casefold()

Expand Down
8 changes: 4 additions & 4 deletions python/samba/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def dot_graph(vertices, edges,
'xterm-256color': {
'alternate rows': (colour.xterm_256_colour(39),
colour.xterm_256_colour(45)),
#'alternate rows': (colour.xterm_256_colour(246),
# 'alternate rows': (colour.xterm_256_colour(246),
# colour.xterm_256_colour(247)),
'disconnected': colour.xterm_256_colour(124, bg=True),
'connected': colour.xterm_256_colour(112),
Expand All @@ -412,7 +412,7 @@ def dot_graph(vertices, edges,
'xterm-256color-heatmap': {
'alternate rows': (colour.xterm_256_colour(171),
colour.xterm_256_colour(207)),
#'alternate rows': (colour.xterm_256_colour(246),
# 'alternate rows': (colour.xterm_256_colour(246),
# colour.xterm_256_colour(247)),
'disconnected': colour.xterm_256_colour(124, bg=True),
'connected': colour.xterm_256_colour(112, bg=True),
Expand Down Expand Up @@ -441,9 +441,9 @@ def dot_graph(vertices, edges,
'vertical': '│',
'horizontal': '─',
'corner': '╭',
#'diagonal': '╲',
# 'diagonal': '╲',
'diagonal': '·',
#'missing': '🕱',
# 'missing': '🕱',
'missing': '-',
'right_arrow': '←',
},
Expand Down
2 changes: 1 addition & 1 deletion python/samba/kcc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1609,7 +1609,7 @@ def add_transports(self, vertex, local_vertex, graph, detect_failed):
# here, but using vertex seems to make more sense. That is,
# the docs want this:
#
#bh = self.get_bridgehead(local_vertex.site, vertex.part, transport,
# bh = self.get_bridgehead(local_vertex.site, vertex.part, transport,
# local_vertex.is_black(), detect_failed)
#
# TODO WHY?????
Expand Down
2 changes: 1 addition & 1 deletion python/samba/kcc/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
WARN = logger.warning


#colours for prettier logs
# colours for prettier logs
from samba.colour import C_NORMAL, REV_RED
from samba.colour import DARK_RED, RED
from samba.colour import DARK_GREEN, GREEN
Expand Down
8 changes: 4 additions & 4 deletions python/samba/kcc/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def combine_repl_info(info_a, info_b):
info_c.interval = max(info_a.interval, info_b.interval)
info_c.options = info_a.options & info_b.options

#schedule of None defaults to "always"
# schedule of None defaults to "always"
if info_a.schedule is None:
info_a.schedule = [0xFF] * 84
if info_b.schedule is None:
Expand Down Expand Up @@ -262,7 +262,7 @@ def get_spanning_tree_edges(graph, my_site, label=None, verify=False,
if verify or dot_file_dir is not None:
graph_edges = [[x.site.site_dnstr for x in e.vertices]
for e in edge_list]
#add the reverse edge if not directed.
# add the reverse edge if not directed.
graph_edges.extend([x.site.site_dnstr
for x in reversed(e.vertices)]
for e in edge_list if not e.directed)
Expand Down Expand Up @@ -578,7 +578,7 @@ def kruskal(graph, edges):
# Sorted based on internal comparison function of internal edge
edges.sort()

#XXX expected_num_tree_edges is never used
# XXX expected_num_tree_edges is never used
expected_num_tree_edges = 0 # TODO this value makes little sense

count_edges = 0
Expand Down Expand Up @@ -734,7 +734,7 @@ def color_vertex(self):
# SET v.Color to COLOR.RED
# ELSEIF s contains one or more partial replicas of the NC
# SET v.Color to COLOR.BLACK
#ELSE
# ELSE
# SET v.Color to COLOR.WHITE

# set to minimum (no replica)
Expand Down
2 changes: 1 addition & 1 deletion python/samba/kcc/kcc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1645,7 +1645,7 @@ def select_istg(self, samdb, mydsa, ro):
i_idx = j_idx
t_time = 0

#XXX doc says current time < c.timeLastSyncSuccess - f
# XXX doc says current time < c.timeLastSyncSuccess - f
# which is true only if f is negative or clocks are wrong.
# f is not negative in the default case (2 hours).
elif self.nt_now - cursor.last_sync_success > f:
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 @@ -726,7 +726,7 @@ def run(self, DC=None, dsa_option=None,
dsa_opts |= self.option_map[flag]
else:
dsa_opts &= ~self.option_map[flag]
#save new options
# save new options
m = ldb.Message()
m.dn = ldb.Dn(self.samdb, ntds_dn)
m["options"] = ldb.MessageElement(str(dsa_opts), ldb.FLAG_MOD_REPLACE, "options")
Expand Down
2 changes: 1 addition & 1 deletion python/samba/netcmd/dsacl.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def add_ace(self, samdb, object_dn, new_ace):
"""Add new ace explicitly."""
desc = self.read_descriptor(samdb, object_dn)
desc_sddl = desc.as_sddl(self.get_domain_sid(samdb))
#TODO add bindings for descriptor manipulation and get rid of this
# TODO add bindings for descriptor manipulation and get rid of this
desc_aces = re.findall("\(.*?\)", desc_sddl)
for ace in desc_aces:
if ("ID" in ace):
Expand Down
8 changes: 4 additions & 4 deletions python/samba/netcmd/fsmo.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def seize_role(self, role, samdb, force):
m.dn = ldb.Dn(samdb, self.schema_dn)
else:
raise CommandError("Invalid FSMO role.")
#first try to transfer to avoid problem if the owner is still active
# first try to transfer to avoid problem if the owner is still active
seize = False
master_owner = get_fsmo_roleowner(samdb, m.dn, role)
# if there is a different owner
Expand All @@ -282,7 +282,7 @@ def seize_role(self, role, samdb, force):
try:
transfer_role(self.outf, role, samdb)
except:
#transfer failed, use the big axe...
# transfer failed, use the big axe...
seize = True
self.message("Transfer unsuccessful, seizing...")
else:
Expand Down Expand Up @@ -352,7 +352,7 @@ def seize_dns_role(self, role, samdb, credopts, sambaopts,
m.dn = ldb.Dn(samdb, self.forestdns_dn)
else:
raise CommandError("Invalid FSMO role.")
#first try to transfer to avoid problem if the owner is still active
# first try to transfer to avoid problem if the owner is still active
seize = False
master_owner = get_fsmo_roleowner(samdb, m.dn, role)
if master_owner is not None:
Expand All @@ -365,7 +365,7 @@ def seize_dns_role(self, role, samdb, credopts, sambaopts,
transfer_dns_role(self.outf, sambaopts, credopts, role,
samdb)
except:
#transfer failed, use the big axe...
# transfer failed, use the big axe...
seize = True
self.message("Transfer unsuccessful, seizing...")
else:
Expand Down
2 changes: 1 addition & 1 deletion python/samba/netcmd/visualize.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ def run(self, H=None, output=None, shorten_names=False,
expression="(objectClass=nTDSConnection)",
attrs=['fromServer'],
# XXX can't be critical for ldif test
#controls=["search_options:1:2"],
# controls=["search_options:1:2"],
controls=["search_options:0:2"],
)

Expand Down
2 changes: 1 addition & 1 deletion python/samba/provision/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ def make_smbconf(smbconf, hostname, domain, realm, targetdir,

if lp is None:
lp = samba.param.LoadParm()
#Load non-existent file
# Load non-existent file
if os.path.exists(smbconf):
lp.load(smbconf)

Expand Down
2 changes: 1 addition & 1 deletion python/samba/provision/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ def provision(self):
# easily kill it
self.slapd_provision_command.append("-d0")

#the command for the final run is the normal script
# the command for the final run is the normal script
self.slapd_command = \
[os.path.join(self.ldapdir,
"slapd-" + self.ldap_instance, "start-slapd")]
Expand Down
6 changes: 3 additions & 3 deletions python/samba/provision/sambadns.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def add_rootservers(samdb, domaindn, prefix):
for rserver in rootservers:
record = [ndr_pack(ARecord(rootservers[rserver], serial=0, ttl=0, rank=dnsp.DNS_RANK_ROOT_HINT))]
# Add AAAA record as well (How does W2K* add IPv6 records?)
#if rserver in rootservers_v6:
# if rserver in rootservers_v6:
# record.append(ndr_pack(AAAARecord(rootservers_v6[rserver], serial=0, ttl=0)))
msg = ldb.Message(ldb.Dn(samdb, "DC=%s,%s" % (rserver, container_dn)))
msg["objectClass"] = ["top", "dnsNode"]
Expand Down Expand Up @@ -1065,7 +1065,7 @@ def fill_dns_data_partitions(samdb, domainsid, site, domaindn, forestdn,
:param autofill: Create DNS records (using fixed template)
"""

##### Set up DC=DomainDnsZones,<DOMAINDN>
# Set up DC=DomainDnsZones,<DOMAINDN>
# Add rootserver records
if add_root:
add_rootservers(samdb, domaindn, "DC=DomainDnsZones")
Expand All @@ -1080,7 +1080,7 @@ def fill_dns_data_partitions(samdb, domainsid, site, domaindn, forestdn,
dnsdomain, hostname, hostip, hostip6)

if fill_level != FILL_SUBDOMAIN:
##### Set up DC=ForestDnsZones,<FORESTDN>
# Set up DC=ForestDnsZones,<FORESTDN>
# Add _msdcs record
add_msdcs_record(samdb, forestdn, "DC=ForestDnsZones", dnsforest)

Expand Down
4 changes: 2 additions & 2 deletions python/samba/tests/dcerpc/testrpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ def check_interface(self, interface, iname):
continue
value = getattr(interface, n)
if isinstance(value, str):
#print "%s=\"%s\"" % (n, value)
# print "%s=\"%s\"" % (n, value)
pass
elif isinstance(value, int) or isinstance(value, long):
#print "%s=%d" % (n, value)
# print "%s=%d" % (n, value)
pass
elif isinstance(value, type):
try:
Expand Down
2 changes: 1 addition & 1 deletion python/samba/tests/kcc/graph_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def test_graph_connected_under_edge_failures(self):
self.assertIsNone(fn(*self.complete_graph))

def test_graph_connected_under_vertex_failures(self):
#XXX no tests to distinguish this from the edge_failures case
# XXX no tests to distinguish this from the edge_failures case
fn = verify_graph_connected_under_vertex_failures

self.assertGraphError(fn, *self.line)
Expand Down
2 changes: 1 addition & 1 deletion python/samba/tests/kcc/ldif_import_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def test_dotfiles(self):
r = subprocess.call([dot, '-Tcanon', ffn])
self.assertEqual(r, 0)

#even if dot is not there, at least check the file is non-empty
# even if dot is not there, at least check the file is non-empty
size = os.stat(ffn).st_size
self.assertNotEqual(size, 0)
files.append(ffn)
Expand Down
6 changes: 3 additions & 3 deletions python/samba/tests/posixacl.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def test_setntacl_invalidate_getntacl(self):
backend_obj.wrap_setxattr(dbname,
self.tempf, "system.fake_access_acl", b"")

#however, as this is direct DB access, we do not notice it
# however, as this is direct DB access, we do not notice it
facl = getntacl(self.lp, self.tempf, direct_db_access=True)
anysid = security.dom_sid(security.SID_NT_SELF)
self.assertEquals(acl, facl.as_sddl(anysid))
Expand All @@ -119,7 +119,7 @@ def test_setntacl_invalidate_getntacl_smbd(self):
backend_obj.wrap_setxattr(dbname,
self.tempf, "system.fake_access_acl", b"")

#the hash would break, and we return an ACL based only on the mode, except we set the ACL using the 'ntvfs' mode that doesn't include a hash
# the hash would break, and we return an ACL based only on the mode, except we set the ACL using the 'ntvfs' mode that doesn't include a hash
facl = getntacl(self.lp, self.tempf)
anysid = security.dom_sid(security.SID_NT_SELF)
self.assertEquals(acl, facl.as_sddl(anysid))
Expand All @@ -136,7 +136,7 @@ def test_setntacl_smbd_invalidate_getntacl_smbd(self):
backend_obj.wrap_setxattr(dbname,
self.tempf, "system.fake_access_acl", b"")

#the hash will break, and we return an ACL based only on the mode
# the hash will break, and we return an ACL based only on the mode
facl = getntacl(self.lp, self.tempf, direct_db_access=False)
anysid = security.dom_sid(security.SID_NT_SELF)
self.assertEquals(simple_acl_from_posix, facl.as_sddl(anysid))
Expand Down
10 changes: 5 additions & 5 deletions python/samba/tests/samba3sam.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def test_s3sam_modify(self):
# Checking for existence of record (local || remote)
msg = self.ldb.search(expression="(|(unixName=bin)(sambaUnicodePwd=geheim))",
attrs=['unixName', 'cn', 'dn', 'sambaUnicodePwd'])
#print "got %d replies" % len(msg)
# print "got %d replies" % len(msg)
self.assertEquals(len(msg), 1) # TODO: should check with more records
self.assertEquals(str(msg[0]["cn"]), "Niemand")
self.assertEquals(str(msg[0]["unixName"]), "bin")
Expand Down Expand Up @@ -484,7 +484,7 @@ def test_map_search(self):
# TODO:
# Using the SID directly in the parse tree leads to conversion
# errors, letting the search fail with no results.
#res = self.ldb.search("(objectSid=S-1-5-21-4231626423-2410014848-2360679739-1052)", scope=SCOPE_DEFAULT, attrs)
# res = self.ldb.search("(objectSid=S-1-5-21-4231626423-2410014848-2360679739-1052)", scope=SCOPE_DEFAULT, attrs)
res = self.ldb.search(expression="(objectSid=*)", base=None, scope=SCOPE_DEFAULT, attrs=["dnsHostName", "lastLogon", "objectSid"])
self.assertEquals(len(res), 4)
res = sorted(res, key=attrgetter('dn'))
Expand Down Expand Up @@ -514,9 +514,9 @@ def test_map_search(self):

# Note that Xs "objectSid" seems to be fine in the previous search for
# "objectSid"...
#res = ldb.search(expression="(primaryGroupID=*)", NULL, ldb. SCOPE_DEFAULT, attrs)
#print len(res) + " results found"
#for i in range(len(res)):
# res = ldb.search(expression="(primaryGroupID=*)", NULL, ldb. SCOPE_DEFAULT, attrs)
# print len(res) + " results found"
# for i in range(len(res)):
# for (obj in res[i]) {
# print obj + ": " + res[i][obj]
# }
Expand Down
4 changes: 2 additions & 2 deletions source3/script/tests/test_wbinfo_sids2xids_int.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def fill_cache(inids, idtype='gid'):
stdout=subprocess.PIPE).communicate()[0]
domsid = domsid.split(' ')[0]

#print domain
#print domsid
# print domain
# print domsid

sids = [domsid + '-512', 'S-1-5-32-545', domsid + '-513', 'S-1-1-0', 'S-1-3-1', 'S-1-5-1']

Expand Down
4 changes: 2 additions & 2 deletions source3/selftest/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def plansmbtorture4testsuite(name, env, options, description=''):

plantestsuite("samba3.blackbox.net_usershare", "fileserver:local", [os.path.join(samba3srcdir, "script/tests/test_net_usershare.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', smbclient3])

#TODO encrypted against member, with member creds, and with DC creds
# TODO encrypted against member, with member creds, and with DC creds
plantestsuite("samba3.blackbox.net.misc", "nt4_dc:local",
[os.path.join(samba3srcdir, "script/tests/test_net_misc.sh"),
scriptdir, "$SMB_CONF_PATH", net, configuration])
Expand Down Expand Up @@ -379,7 +379,7 @@ def plansmbtorture4testsuite(name, env, options, description=''):
plantestsuite("samba3.async_req", "nt4_dc",
[os.path.join(samba3srcdir, "script/tests/test_async_req.sh")])

#smbtorture4 tests
# smbtorture4 tests

base = ["base.attr", "base.charset", "base.chkpath", "base.createx_access", "base.defer_open", "base.delaywrite", "base.delete",
"base.deny1", "base.deny2", "base.deny3", "base.denydos", "base.dir1", "base.dir2",
Expand Down
Loading

0 comments on commit 7a07d42

Please sign in to comment.