diff options
author | Joe Guo <joeg@catalyst.net.nz> | 2018-07-30 18:19:49 +1200 |
---|---|---|
committer | Douglas Bagnall <dbagnall@samba.org> | 2018-08-24 07:49:29 +0200 |
commit | 7a07d4223028ed34cca20d2fcdf4f1bca1856c8b (patch) | |
tree | edb3a2545c08c564b459b5369175f6c9b1a84ed2 /python | |
parent | c809a86023a2eb1c6802c8b3aa68c00f1ea03952 (diff) | |
download | samba-7a07d4223028ed34cca20d2fcdf4f1bca1856c8b.tar.gz |
PEP8: fix E265: block comment should start with '# '
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>
Diffstat (limited to 'python')
-rw-r--r-- | python/samba/__init__.py | 2 | ||||
-rw-r--r-- | python/samba/graph.py | 8 | ||||
-rw-r--r-- | python/samba/kcc/__init__.py | 2 | ||||
-rw-r--r-- | python/samba/kcc/debug.py | 2 | ||||
-rw-r--r-- | python/samba/kcc/graph.py | 8 | ||||
-rw-r--r-- | python/samba/kcc/kcc_utils.py | 2 | ||||
-rw-r--r-- | python/samba/netcmd/drs.py | 2 | ||||
-rw-r--r-- | python/samba/netcmd/dsacl.py | 2 | ||||
-rw-r--r-- | python/samba/netcmd/fsmo.py | 8 | ||||
-rw-r--r-- | python/samba/netcmd/visualize.py | 2 | ||||
-rw-r--r-- | python/samba/provision/__init__.py | 2 | ||||
-rw-r--r-- | python/samba/provision/backend.py | 2 | ||||
-rw-r--r-- | python/samba/provision/sambadns.py | 6 | ||||
-rw-r--r-- | python/samba/tests/dcerpc/testrpc.py | 4 | ||||
-rw-r--r-- | python/samba/tests/kcc/graph_utils.py | 2 | ||||
-rw-r--r-- | python/samba/tests/kcc/ldif_import_export.py | 2 | ||||
-rw-r--r-- | python/samba/tests/posixacl.py | 6 | ||||
-rw-r--r-- | python/samba/tests/samba3sam.py | 10 |
18 files changed, 36 insertions, 36 deletions
diff --git a/python/samba/__init__.py b/python/samba/__init__.py index a79b1fdf473..f6fb58461a7 100644 --- a/python/samba/__init__.py +++ b/python/samba/__init__.py @@ -99,7 +99,7 @@ class Ldb(_Ldb): # TODO set debug def msg(l, text): print(text) - #self.set_debug(msg) + # self.set_debug(msg) self.set_utf8_casefold() diff --git a/python/samba/graph.py b/python/samba/graph.py index 7ca86bf82e5..2f3bc9c67eb 100644 --- a/python/samba/graph.py +++ b/python/samba/graph.py @@ -395,7 +395,7 @@ COLOUR_SETS = { '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), @@ -412,7 +412,7 @@ COLOUR_SETS = { '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), @@ -441,9 +441,9 @@ CHARSETS = { 'vertical': '│', 'horizontal': '─', 'corner': '╭', - #'diagonal': '╲', + # 'diagonal': '╲', 'diagonal': '·', - #'missing': '🕱', + # 'missing': '🕱', 'missing': '-', 'right_arrow': '←', }, diff --git a/python/samba/kcc/__init__.py b/python/samba/kcc/__init__.py index 8f214f2822d..8bb9a3904bb 100644 --- a/python/samba/kcc/__init__.py +++ b/python/samba/kcc/__init__.py @@ -1609,7 +1609,7 @@ class KCC(object): # 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????? diff --git a/python/samba/kcc/debug.py b/python/samba/kcc/debug.py index 4fab33a5089..24c70d0de3a 100644 --- a/python/samba/kcc/debug.py +++ b/python/samba/kcc/debug.py @@ -29,7 +29,7 @@ DEBUG = logger.debug 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 diff --git a/python/samba/kcc/graph.py b/python/samba/kcc/graph.py index d87530d40c3..327b471201f 100644 --- a/python/samba/kcc/graph.py +++ b/python/samba/kcc/graph.py @@ -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: @@ -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) @@ -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 @@ -734,7 +734,7 @@ class Vertex(object): # 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) diff --git a/python/samba/kcc/kcc_utils.py b/python/samba/kcc/kcc_utils.py index c58d5d23217..b19cc109c51 100644 --- a/python/samba/kcc/kcc_utils.py +++ b/python/samba/kcc/kcc_utils.py @@ -1645,7 +1645,7 @@ class Site(object): 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: diff --git a/python/samba/netcmd/drs.py b/python/samba/netcmd/drs.py index 96660e678ef..7f4ca3fc120 100644 --- a/python/samba/netcmd/drs.py +++ b/python/samba/netcmd/drs.py @@ -726,7 +726,7 @@ class cmd_drs_options(Command): 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") diff --git a/python/samba/netcmd/dsacl.py b/python/samba/netcmd/dsacl.py index 4ca15cdc99d..f5ee9141799 100644 --- a/python/samba/netcmd/dsacl.py +++ b/python/samba/netcmd/dsacl.py @@ -115,7 +115,7 @@ class cmd_dsacl_set(Command): """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): diff --git a/python/samba/netcmd/fsmo.py b/python/samba/netcmd/fsmo.py index 3dab02407dc..5f67b30dedb 100644 --- a/python/samba/netcmd/fsmo.py +++ b/python/samba/netcmd/fsmo.py @@ -269,7 +269,7 @@ You must provide an Admin user and password."""), 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 @@ -282,7 +282,7 @@ You must provide an Admin user and password."""), 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: @@ -352,7 +352,7 @@ You must provide an Admin user and password."""), 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: @@ -365,7 +365,7 @@ You must provide an Admin user and password."""), 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: diff --git a/python/samba/netcmd/visualize.py b/python/samba/netcmd/visualize.py index 2072d90e955..93c0929326e 100644 --- a/python/samba/netcmd/visualize.py +++ b/python/samba/netcmd/visualize.py @@ -501,7 +501,7 @@ class cmd_ntdsconn(GraphCommand): 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"], ) diff --git a/python/samba/provision/__init__.py b/python/samba/provision/__init__.py index 7012445b385..0d80200ef95 100644 --- a/python/samba/provision/__init__.py +++ b/python/samba/provision/__init__.py @@ -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) diff --git a/python/samba/provision/backend.py b/python/samba/provision/backend.py index e2e372e8b59..579308899e5 100644 --- a/python/samba/provision/backend.py +++ b/python/samba/provision/backend.py @@ -795,7 +795,7 @@ class FDSBackend(LDAPBackend): # 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")] diff --git a/python/samba/provision/sambadns.py b/python/samba/provision/sambadns.py index e364b37a1f1..3afe94cb9b4 100644 --- a/python/samba/provision/sambadns.py +++ b/python/samba/provision/sambadns.py @@ -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"] @@ -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") @@ -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) diff --git a/python/samba/tests/dcerpc/testrpc.py b/python/samba/tests/dcerpc/testrpc.py index f8191ba2dbe..1ebe34e6247 100644 --- a/python/samba/tests/dcerpc/testrpc.py +++ b/python/samba/tests/dcerpc/testrpc.py @@ -95,10 +95,10 @@ class RpcTests(object): 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: diff --git a/python/samba/tests/kcc/graph_utils.py b/python/samba/tests/kcc/graph_utils.py index b027838e78f..2ba7f440664 100644 --- a/python/samba/tests/kcc/graph_utils.py +++ b/python/samba/tests/kcc/graph_utils.py @@ -130,7 +130,7 @@ class UndirectedGraphTests(samba.tests.TestCase): 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) diff --git a/python/samba/tests/kcc/ldif_import_export.py b/python/samba/tests/kcc/ldif_import_export.py index 1350f9b5e96..47eb3c3ffbc 100644 --- a/python/samba/tests/kcc/ldif_import_export.py +++ b/python/samba/tests/kcc/ldif_import_export.py @@ -235,7 +235,7 @@ class KCCMultisiteLdifTests(samba.tests.TestCaseInTempDir): 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) diff --git a/python/samba/tests/posixacl.py b/python/samba/tests/posixacl.py index 5926c11b158..68dbaa63543 100644 --- a/python/samba/tests/posixacl.py +++ b/python/samba/tests/posixacl.py @@ -104,7 +104,7 @@ class PosixAclMappingTests(TestCaseInTempDir): 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)) @@ -119,7 +119,7 @@ class PosixAclMappingTests(TestCaseInTempDir): 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)) @@ -136,7 +136,7 @@ class PosixAclMappingTests(TestCaseInTempDir): 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)) diff --git a/python/samba/tests/samba3sam.py b/python/samba/tests/samba3sam.py index 1221435fcbc..8ea6cad060f 100644 --- a/python/samba/tests/samba3sam.py +++ b/python/samba/tests/samba3sam.py @@ -234,7 +234,7 @@ class Samba3SamTestCase(MapBaseTestCase): # 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") @@ -484,7 +484,7 @@ objectSid: S-1-5-21-4231626423-2410014848-2360679739-1052 # 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')) @@ -514,9 +514,9 @@ objectSid: S-1-5-21-4231626423-2410014848-2360679739-1052 # 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] # } |