PEP8: fix E261: at least two spaces before inline comment
authorJoe Guo <joeg@catalyst.net.nz>
Mon, 30 Jul 2018 06:19:33 +0000 (18:19 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Fri, 24 Aug 2018 05:49:29 +0000 (07:49 +0200)
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>
34 files changed:
examples/scripts/vfs/media_harmony/trigger_avid_update.py
python/samba/gpclass.py
python/samba/ms_schema.py
python/samba/netcmd/domain.py
python/samba/netcmd/ldapcmp.py
python/samba/netcmd/user.py
python/samba/samba3/__init__.py
python/samba/tests/dcerpc/dnsserver.py
python/samba/tests/dcerpc/registry.py
python/samba/tests/dcerpc/srvsvc.py
python/samba/tests/dcerpc/testrpc.py
python/samba/tests/kcc/__init__.py
python/samba/tests/pam_winbind.py
python/samba/tests/pam_winbind_warn_pwd_expire.py
python/samba/tests/samba_tool/dnscmd.py
python/samba/tests/samba_tool/sites.py
python/samba/upgrade.py
script/autobuild.py
selftest/subunithelper.py
source4/dsdb/tests/python/acl.py
source4/dsdb/tests/python/ad_dc_medley_performance.py
source4/dsdb/tests/python/ad_dc_search_performance.py
source4/dsdb/tests/python/dirsync.py
source4/dsdb/tests/python/ldap.py
source4/dsdb/tests/python/passwords.py
source4/dsdb/tests/python/rodc_rwdc.py
source4/dsdb/tests/python/sec_descriptor.py
source4/dsdb/tests/python/sites.py
source4/dsdb/tests/python/user_account_control.py
source4/lib/wmi/wmi.py
source4/torture/drs/python/cracknames.py
source4/torture/drs/python/repl_rodc.py
wintest/test-s4-howto.py
wintest/wintest.py

index 938b3d11053152bd0cc289382ab2025c3972806a..ca7e7d89095d37a9ba22cad5d2bf67bbbe18bc56 100755 (executable)
@@ -85,7 +85,7 @@ if __name__ == "__main__":
                                newer_file = True
 
                        if newer_file:
-                               utime = None # Sets to current time.
+                               utime = None  # Sets to current time.
                                print '...Setting fake mtime to NOW.  Will trigger re-index.'
                        else:
                                mtime = os.stat(media_dir)[stat.ST_MTIME]
index eb622b1c9671f070981585a0881f1335d7019938..0cadcd45fc7c1f1d774f6f8e0707f661e7a484ea 100644 (file)
@@ -507,7 +507,7 @@ def unapply_gp(lp, creds, test_ldb, logger, store, gp_extensions):
         unapply_attributes = gp_db.list(gp_extensions)
         for attr in unapply_attributes:
             attr_obj = attr[-1](logger, test_ldb, gp_db, lp, attr[0], attr[1])
-            attr_obj.mapper()[attr[0]][0](attr[1]) # Set the old value
+            attr_obj.mapper()[attr[0]][0](attr[1])  # Set the old value
             gp_db.delete(str(attr_obj), attr[0])
         gp_db.commit()
 
index 21e91d311ab8dcd4726094d0dde42a4a053bed29..850bdca3ae5c8da31330be2790d26582d78590ca 100644 (file)
@@ -36,14 +36,14 @@ bitFields["searchflags"] = {
     'fTUPLEINDEX': 26,       # TP
     'fSUBTREEATTINDEX': 25,  # ST
     'fCONFIDENTIAL': 24,     # CF
-    'fCONFIDENTAIL': 24, # typo
+    'fCONFIDENTAIL': 24,  # typo
     'fNEVERVALUEAUDIT': 23,  # NV
     'fRODCAttribute': 22,    # RO
 
 
     # missing in ADTS but required by LDIF
     'fRODCFilteredAttribute': 22,    # RO
-    'fRODCFILTEREDATTRIBUTE': 22, # case
+    'fRODCFILTEREDATTRIBUTE': 22,  # case
     'fEXTENDEDLINKTRACKING': 21,  # XL
     'fBASEONLY': 20,  # BO
     'fPARTITIONSECRET': 19,  # SE
index 40117251450f90058a8ac358250d6182a6240ac5..889aa922eac497a40792b040fa0177922c212891 100644 (file)
@@ -1057,7 +1057,7 @@ class cmd_domain_level(Command):
     takes_options = [
         Option("-H", "--URL", help="LDB URL for database or target server", type=str,
                metavar="URL", dest="H"),
-        Option("-q", "--quiet", help="Be quiet", action="store_true"), # unused
+        Option("-q", "--quiet", help="Be quiet", action="store_true"),  # unused
         Option("--forest-level", type="choice", choices=["2003", "2008", "2008_R2", "2012", "2012_R2"],
                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"],
@@ -1364,7 +1364,7 @@ class cmd_domain_passwordsettings_set(Command):
     takes_options = [
         Option("-H", "--URL", help="LDB URL for database or target server", type=str,
                metavar="URL", dest="H"),
-        Option("-q", "--quiet", help="Be quiet", action="store_true"), # unused
+        Option("-q", "--quiet", help="Be quiet", action="store_true"),  # unused
         Option("--complexity", type="choice", choices=["on", "off", "default"],
                help="The password complexity (on | off | default). Default is 'on'"),
         Option("--store-plaintext", type="choice", choices=["on", "off", "default"],
@@ -4028,7 +4028,7 @@ class cmd_domain_schema_upgrade(Command):
     takes_options = [
         Option("-H", "--URL", help="LDB URL for database or target server", type=str,
                metavar="URL", dest="H"),
-        Option("-q", "--quiet", help="Be quiet", action="store_true"), #unused
+        Option("-q", "--quiet", help="Be quiet", action="store_true"),  # unused
         Option("-v", "--verbose", help="Be verbose", action="store_true"),
         Option("--schema", type="choice", metavar="SCHEMA",
                choices=["2012", "2012_R2"],
index 3f4d63d989f07ba395a5ec471b01943c062da009..3b0e0d536cf2b66715b989cb377c58ebbc6840b6 100644 (file)
@@ -439,7 +439,7 @@ class LDAPObject(object):
                 "uSNChanged",
                 "uSNCreated",
                 "uSNLastObjRem",
-                "whenChanged", # This is implicitly replicated, but may diverge on updates of non-replicated attributes
+                "whenChanged",  # This is implicitly replicated, but may diverge on updates of non-replicated attributes
         ]
         self.ignore_attributes = self.non_replicated_attributes
         self.ignore_attributes += ["msExchServer1HighestUSN"]
@@ -677,7 +677,7 @@ class LDAPObject(object):
         self.summary["unique_attrs"] += self.unique_attrs
         self.summary["df_value_attrs"] += self.df_value_attrs
         other.summary["unique_attrs"] += other.unique_attrs
-        other.summary["df_value_attrs"] += self.df_value_attrs # they are the same
+        other.summary["df_value_attrs"] += self.df_value_attrs  # they are the same
         #
         self.screen_output = res[:-1]
         other.screen_output = res[:-1]
index 677e0a91559dac4d30cfc8a9be428424d4eadfcf..ab00a07b8f65075cba0d25009e6fd43e19624c26 100644 (file)
@@ -2202,7 +2202,7 @@ samba-tool user syncpasswords --terminate \\
             if pid == 0:
                 os.setsid()
                 pid = os.fork()
-                if pid == 0: # Actual daemon
+                if pid == 0:  # Actual daemon
                     pid = os.getpid()
                     log_msg("Daemonized as pid %d (from %d)\n" % (pid, orig_pid))
                     load_cache()
@@ -2220,7 +2220,7 @@ samba-tool user syncpasswords --terminate \\
             import resource      # Resource usage information.
             maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
             if maxfd == resource.RLIM_INFINITY:
-                maxfd = 1024 # Rough guess at maximum number of open file descriptors.
+                maxfd = 1024  # Rough guess at maximum number of open file descriptors.
             logfd = os.open(logfile, os.O_WRONLY | os.O_APPEND | os.O_CREAT, 0o600)
             self.outf.write("Using logfile[%s]\n" % logfile)
             for fd in range(0, maxfd):
index 950b3c28479f4914e250b0583baad8dcdce057ab..283185aa823363061d27c787d47cb321c7137806 100644 (file)
@@ -324,7 +324,7 @@ class WinsDatabase(object):
         f = open(file, 'r')
         assert f.readline().rstrip("\n") == "VERSION 1 0"
         for l in f.readlines():
-            if l[0] == "#": # skip comments
+            if l[0] == "#":  # skip comments
                 continue
             entries = shellsplit(l.rstrip("\n"))
             name = entries[0]
@@ -352,7 +352,7 @@ class WinsDatabase(object):
         """Return the entries in this WINS database."""
         return self.entries.items()
 
-    def close(self): # for consistency
+    def close(self):  # for consistency
         pass
 
 
index c45d81e69fb32964076a0866ed7766f58cfd7da6..e0fff73ad787887346a48dac8b90f154c34c096f 100644 (file)
@@ -172,7 +172,7 @@ class DnsserverTests(RpcInterfaceTestCase):
         self.add_record(self.custom_zone, "testrecord", record_type_str, record_str)
 
         dn, record = self.get_record_from_db(self.custom_zone, "testrecord")
-        record.rank = 0 # DNS_RANK_NONE
+        record.rank = 0  # DNS_RANK_NONE
         res = self.samdb.dns_replace_by_dn(dn, [record])
         if res is not None:
             self.fail("Unable to update dns record to have DNS_RANK_NONE.")
index 95de0d0703f7a65e8397b0b02aaff35339598258..279eeb1cc822e7c7307913cb87b1133a0f1ba3c0 100644 (file)
@@ -47,5 +47,5 @@ class WinregTests(RpcInterfaceTestCase):
         handle = self.conn.OpenHKLM(None,
                                     winreg.KEY_QUERY_VALUE | winreg.KEY_ENUMERATE_SUB_KEYS)
         x = self.conn.QueryInfoKey(handle, winreg.String())
-        self.assertEquals(9, len(x)) # should return a 9-tuple
+        self.assertEquals(9, len(x))  # should return a 9-tuple
         self.conn.CloseKey(handle)
index a3e60757483cda8204fad37f27129289097e0f84..4590ca5a412887c7d4f09d9ed406643c7c285496 100644 (file)
@@ -40,7 +40,7 @@ class SrvsvcTests(RpcInterfaceTestCase):
         share.current_users = 0x00000000
         share.max_users = -1
         share.password = None
-        share.path = u'C:\\tmp' # some random path
+        share.path = u'C:\\tmp'  # some random path
         share.permissions = 123434566
         return share
 
index 5aadcf48eedeb5a51bc6e9028be9c08ec12a0c2f..f8191ba2dbe26e200268af88356fe2e71f1dd348 100644 (file)
@@ -109,7 +109,7 @@ class RpcTests(object):
                     print("ERROR: Failed to check_type %s.%s: %r: %s" % (iname, n, e.__class__, e))
                     self.errcount += 1
             elif callable(value):
-                pass # Method
+                pass  # Method
             else:
                 print("UNKNOWN: %s=%s" % (n, value))
         if self.errcount - errcount != 0:
index ee09a78689a9859964408fad63d000163838d74a..b251802280569f821926147912310a3568ed6fc5 100644 (file)
@@ -35,7 +35,7 @@ from samba.credentials import Credentials
 from samba.samdb import SamDB
 
 unix_now = int(time.time())
-unix_once_upon_a_time = 1000000000 #2001-09-09
+unix_once_upon_a_time = 1000000000  # 2001-09-09
 
 ENV_DSAS = {
     'ad_dc_ntvfs': ['CN=LOCALDC,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=samba,DC=example,DC=com'],
index d64600e8566e57b85796be073428b13a31ce6b5e..0f38469da0bff249c53be41e172830ce4631384d 100644 (file)
@@ -26,7 +26,7 @@ class SimplePamTests(samba.tests.TestCase):
         username = os.environ["USERNAME"]
         password = os.environ["PASSWORD"]
         unix_username = "%s/%s" % (domain, username)
-        expected_rc = 0 # PAM_SUCCESS
+        expected_rc = 0  # PAM_SUCCESS
 
         tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rc)
         res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
@@ -38,7 +38,7 @@ class SimplePamTests(samba.tests.TestCase):
         username = os.environ["USERNAME"]
         password = "WrongPassword"
         unix_username = "%s/%s" % (domain, username)
-        expected_rc = 7 # PAM_AUTH_ERR
+        expected_rc = 7  # PAM_AUTH_ERR
 
         tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rc)
         res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
@@ -48,7 +48,7 @@ class SimplePamTests(samba.tests.TestCase):
         # Authenticate again to check that we are not locked out with just one
         # failed login
         password = os.environ["PASSWORD"]
-        expected_rc = 0 # PAM_SUCCESS
+        expected_rc = 0  # PAM_SUCCESS
 
         tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rc)
         res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
index c573657c4ddeda5fa2cf402e1949ad4c02fcccb1..c3b7e1dbfcab32a0c31ac42b90c88c03d09f8504 100644 (file)
@@ -27,7 +27,7 @@ class PasswordExpirePamTests(samba.tests.TestCase):
         password = os.environ["PASSWORD"]
         warn_pwd_expire = int(os.environ["WARN_PWD_EXPIRE"])
         unix_username = "%s/%s" % (domain, username)
-        expected_rc = 0 # PAM_SUCCESS
+        expected_rc = 0  # PAM_SUCCESS
 
         tc = pypamtest.TestCase(pypamtest.PAMTEST_AUTHENTICATE, expected_rc)
         res = pypamtest.run_pamtest(unix_username, "samba", [tc], [password])
index 9bbc65827c54c44be00c69bdf0df7a7778796e07..ccd7e8f2c1ede588ceebd8342f2f1538df3cd2bd 100644 (file)
@@ -171,7 +171,7 @@ class DnsCmdTestCase(SambaToolCmdTest):
                               % (record_str, record_type_str))
 
         dn, record = self.get_record_from_db(self.zone, "testrecord")
-        record.rank = 0 # DNS_RANK_NONE
+        record.rank = 0  # DNS_RANK_NONE
         res = self.samdb.dns_replace_by_dn(dn, [record])
         if res is not None:
             self.fail("Unable to update dns record to have DNS_RANK_NONE.")
@@ -386,7 +386,7 @@ class DnsCmdTestCase(SambaToolCmdTest):
                 try:
                     self.assertCmdFail(result)
                 except AssertionError:
-                    continue # Don't check this one, because record2 _is_ a valid entry of dnstype1.
+                    continue  # Don't check this one, because record2 _is_ a valid entry of dnstype1.
 
                 # Check both ways: Give the current type and try to update,
                 # and give the new type and try to update.
@@ -484,7 +484,7 @@ class DnsCmdTestCase(SambaToolCmdTest):
         # we can't enter the wrong current value for a given record.
         for dnstype in self.good_records:
             if len(self.good_records[dnstype]) < 3:
-                continue # Not enough records of this type to do this test
+                continue  # Not enough records of this type to do this test
 
             used_record = self.good_records[dnstype][0]
             unused_record = self.good_records[dnstype][1]
index 228f28d9272a9a5503c51a3a9865ab5153d1cffb..89197f7764abbadd15cddaa154c39ffc14369b37 100644 (file)
@@ -77,9 +77,9 @@ class SitesSubnetCmdTestCase(BaseSitesCmdTestCase):
     def test_site_subnet_create(self):
         cidrs = (("10.9.8.0/24", self.sitename),
                  ("50.60.0.0/16", self.sitename2),
-                 ("50.61.0.0/16", self.sitename2), # second subnet on the site
-                 ("50.0.0.0/8", self.sitename), # overlapping subnet, other site
-                 ("50.62.1.2/32", self.sitename), # single IP
+                 ("50.61.0.0/16", self.sitename2),  # second subnet on the site
+                 ("50.0.0.0/8", self.sitename),  # overlapping subnet, other site
+                 ("50.62.1.2/32", self.sitename),  # single IP
                  ("aaaa:bbbb:cccc:dddd:eeee:ffff:2222:1100/120",
                   self.sitename2),
                  )
@@ -114,7 +114,7 @@ class SitesSubnetCmdTestCase(BaseSitesCmdTestCase):
     def test_site_subnet_create_should_fail(self):
         cidrs = (("10.9.8.0/33", self.sitename),    # mask too big
                  ("50.60.0.0/8", self.sitename2),   # insufficient zeros
-                 ("50.261.0.0/16", self.sitename2), # bad octet
+                 ("50.261.0.0/16", self.sitename2),  # bad octet
                  ("7.0.0.0.0/0", self.sitename),    # insufficient zeros
                  ("aaaa:bbbb:cccc:dddd:eeee:ffff:2222:1100/119",
                   self.sitename),                   # insufficient zeros
index c340575b2c28bb4b341cd286f5079362d12251f3..2e17f186a95c6e9ee4126c24347c8e4202265e65 100644 (file)
@@ -351,9 +351,9 @@ def import_wins(samba4_winsdb, samba3_winsdb):
                 rType = 0x0
 
         if ttl > time.time():
-            rState = 0x0 # active
+            rState = 0x0  # active
         else:
-            rState = 0x1 # released
+            rState = 0x1  # released
 
         nType = ((nb_flags & 0x60) >> 5)
 
index 9a1e54060a207b010a29645f71956748d9c865ed..d3b46e69f26046f359fd2a5a106fb1a6b8fcd2cf 100755 (executable)
@@ -607,18 +607,18 @@ def find_git_root():
 
 def daemonize(logfile):
     pid = os.fork()
-    if pid == 0: # Parent
+    if pid == 0:  # Parent
         os.setsid()
         pid = os.fork()
-        if pid != 0: # Actual daemon
+        if pid != 0:  # Actual daemon
             os._exit(0)
-    else: # Grandparent
+    else:  # Grandparent
         os._exit(0)
 
     import resource      # Resource usage information.
     maxfd = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
     if maxfd == resource.RLIM_INFINITY:
-        maxfd = 1024 # Rough guess at maximum number of open file descriptors.
+        maxfd = 1024  # Rough guess at maximum number of open file descriptors.
     for fd in range(0, maxfd):
         try:
             os.close(fd)
index 2955d80011cdefa2d13fc2ba6c44ee5e88e7625b..3ac2d963a90842a9fabd55bdc560ab11b4577739 100644 (file)
@@ -280,7 +280,7 @@ class ImmediateFail(Exception):
 class FilterOps(unittest.TestResult):
 
     def control_msg(self, msg):
-        pass # We regenerate control messages, so ignore this
+        pass  # We regenerate control messages, so ignore this
 
     def time(self, time):
         self._ops.time(time)
index 30be1c77520c577a07a99d53f646a83677b70be8..bea78a341e095251f216837d128c523f3b8b347e 100755 (executable)
@@ -98,7 +98,7 @@ class AclTests(samba.tests.TestCase):
         creds_tmp.set_workstation(creds.get_workstation())
         creds_tmp.set_gensec_features(creds_tmp.get_gensec_features()
                                       | gensec.FEATURE_SEAL)
-        creds_tmp.set_kerberos_state(DONT_USE_KERBEROS) # kinit is too expensive to use in a tight loop
+        creds_tmp.set_kerberos_state(DONT_USE_KERBEROS)  # kinit is too expensive to use in a tight loop
         ldb_target = SamDB(url=ldaphost, credentials=creds_tmp, lp=lp)
         return ldb_target
 
index 9ea1b6aac7c20e6e8f12ed4f698893d705ae18f0..f2a8fea60b5617701ae4c8248f2768d621e2cc04 100644 (file)
@@ -254,7 +254,7 @@ class UserTests(samba.tests.TestCase):
     def _test_complex_search(self, n=100):
         classes = ['samaccountname', 'objectCategory', 'dn', 'member']
         values = ['*', '*t*', 'g*', 'user']
-        comparators = ['=', '<=', '>='] # '~=' causes error
+        comparators = ['=', '<=', '>=']  # '~=' causes error
         maybe_not = ['!(', '']
         joiners = ['&', '|']
 
index 7911f20564e1f0441db3eed7d345207142d2fe68..e24694616440071df373d6213325f1d74913f851 100644 (file)
@@ -177,7 +177,7 @@ class UserTests(samba.tests.TestCase):
     def _test_complex_search(self):
         classes = ['samaccountname', 'objectCategory', 'dn', 'member']
         values = ['*', '*t*', 'g*', 'user']
-        comparators = ['=', '<=', '>='] # '~=' causes error
+        comparators = ['=', '<=', '>=']  # '~=' causes error
         maybe_not = ['!(', '']
         joiners = ['&', '|']
 
index 71ea23f05e8ce654bdd48473ddb8d9daf164ded4..97332760122fb386e655846164db9186b9703164 100755 (executable)
@@ -98,7 +98,7 @@ class DirsyncBaseTests(samba.tests.TestCase):
         creds_tmp.set_workstation(creds.get_workstation())
         creds_tmp.set_gensec_features(creds_tmp.get_gensec_features()
                                       | gensec.FEATURE_SEAL)
-        creds_tmp.set_kerberos_state(DONT_USE_KERBEROS) # kinit is too expensive to use in a tight loop
+        creds_tmp.set_kerberos_state(DONT_USE_KERBEROS)  # kinit is too expensive to use in a tight loop
         ldb_target = SamDB(url=ldaphost, credentials=creds_tmp, lp=lp)
         return ldb_target
 
index 6e4d3e3e39b5ef9b20fb8ac9c579e0ab83624d07..95c721e7499d24a9ca41eb911eee768de77340d3 100755 (executable)
@@ -1679,9 +1679,9 @@ objectGUID: bd3480c9-58af-4cd8-92df-bc4a18b6e44d
         self.assertFalse("description" in res[0])
         self.assertTrue("objectGUID" in res[0])
         self.assertTrue("uSNCreated" in res[0])
-        self.assertFalse(res[0]["uSNCreated"][0] == "1") # these are corrected
+        self.assertFalse(res[0]["uSNCreated"][0] == "1")  # these are corrected
         self.assertTrue("uSNChanged" in res[0])
-        self.assertFalse(res[0]["uSNChanged"][0] == "1") # these are corrected
+        self.assertFalse(res[0]["uSNChanged"][0] == "1")  # these are corrected
         self.assertTrue("whenCreated" in res[0])
         self.assertTrue("whenChanged" in res[0])
 
index c7e94b2625b0099fd7454a217e33628fcd939414..2ab1b77ea19117e2c719ed184c87c76bbd57a38b 100755 (executable)
@@ -746,7 +746,7 @@ userPassword: thatsAcomplPASS4
         except LdbError as e35:
             (num, _) = e35.args
             self.assertTrue(num == ERR_CONSTRAINT_VIOLATION or
-                            num == ERR_NO_SUCH_ATTRIBUTE) # for Windows
+                            num == ERR_NO_SUCH_ATTRIBUTE)  # for Windows
 
         delete_force(self.ldb, "cn=testuser2,cn=users," + self.base_dn)
 
@@ -789,7 +789,7 @@ userPassword: thatsAcomplPASS4
         except LdbError as e39:
             (num, _) = e39.args
             self.assertTrue(num == ERR_CONSTRAINT_VIOLATION or
-                            num == ERR_NO_SUCH_ATTRIBUTE) # for Windows
+                            num == ERR_NO_SUCH_ATTRIBUTE)  # for Windows
 
         m = Message()
         m.dn = Dn(self.ldb, "cn=testuser,cn=users," + self.base_dn)
@@ -830,7 +830,7 @@ userPassword: thatsAcomplPASS4
         except LdbError as e43:
             (num, _) = e43.args
             self.assertTrue(num == ERR_UNWILLING_TO_PERFORM or
-                            num == ERR_NO_SUCH_ATTRIBUTE) # for Windows
+                            num == ERR_NO_SUCH_ATTRIBUTE)  # for Windows
 
         m = Message()
         m.dn = Dn(self.ldb, "cn=testuser,cn=users," + self.base_dn)
@@ -871,7 +871,7 @@ userPassword: thatsAcomplPASS4
         except LdbError as e47:
             (num, _) = e47.args
             self.assertTrue(num == ERR_CONSTRAINT_VIOLATION or
-                            num == ERR_NO_SUCH_ATTRIBUTE) # for Windows
+                            num == ERR_NO_SUCH_ATTRIBUTE)  # for Windows
 
     def test_plain_userPassword(self):
         print("Performs testing about the standard 'userPassword' behaviour")
@@ -879,7 +879,7 @@ userPassword: thatsAcomplPASS4
         # Delete the "dSHeuristics"
         self.ldb.set_dsheuristics(None)
 
-        time.sleep(1) # This switching time is strictly needed!
+        time.sleep(1)  # This switching time is strictly needed!
 
         m = Message()
         m.dn = Dn(self.ldb, "cn=testuser,cn=users," + self.base_dn)
@@ -1105,7 +1105,7 @@ clearTextPassword: thatsAcomplPASS2
 """)
         except LdbError, (num, msg):
             self.assertTrue(num == ERR_CONSTRAINT_VIOLATION or
-                            num == ERR_NO_SUCH_ATTRIBUTE) # for Windows
+                            num == ERR_NO_SUCH_ATTRIBUTE)  # for Windows
         else:
             self.fail()
 
index 7d8d25a0d8c9f1742bdc2bc51b5dc2e862ebd3b5..0126f03195b550b61090af320ea3ad0be2ee3c83 100644 (file)
@@ -187,7 +187,7 @@ class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase):
         set_auto_replication(RWDC, True)
 
     def setUp(self):
-        self.kerberos = False # To be set later
+        self.kerberos = False  # To be set later
 
         self.rodc_db = SamDB('ldap://%s' % RODC, credentials=CREDS,
                              session_info=system_session(LP), lp=LP)
index 7b9f6083f8241dd017c6bbb48f7d9eb2788d0611..858f9337e18fd5dc1ce183b615a7728c44b8a979 100755 (executable)
@@ -139,7 +139,7 @@ showInAdvancedViewOnly: TRUE
         creds_tmp.set_workstation(creds.get_workstation())
         creds_tmp.set_gensec_features(creds_tmp.get_gensec_features()
                                       | gensec.FEATURE_SEAL)
-        creds_tmp.set_kerberos_state(DONT_USE_KERBEROS) # kinit is too expensive to use in a tight loop
+        creds_tmp.set_kerberos_state(DONT_USE_KERBEROS)  # kinit is too expensive to use in a tight loop
         ldb_target = SamDB(url=host, credentials=creds_tmp, lp=lp)
         return ldb_target
 
@@ -355,7 +355,7 @@ class OwnerGroupDescriptorTests(DescriptorTests):
     def check_modify_inheritance(self, _ldb, object_dn, owner_group=""):
         # Modify
         sd_user_utils = sd_utils.SDUtils(_ldb)
-        ace = "(D;;CC;;;LG)" # Deny Create Children to Guest account
+        ace = "(D;;CC;;;LG)"  # Deny Create Children to Guest account
         if owner_group != "":
             sd_user_utils.modify_sd_on_dn(object_dn, owner_group + "D:" + ace)
         else:
@@ -1366,7 +1366,7 @@ class DaclDescriptorTests(DescriptorTests):
         # Make sure created group object contains only the above inherited ACE
         # that we've added manually
         desc_sddl = self.sd_utils.get_sd_as_sddl(group_dn)
-        mod = mod.replace(";OI;", ";OIIOID;") # change it how it's gonna look like
+        mod = mod.replace(";OI;", ";OIIOID;")  # change it how it's gonna look like
         self.assertTrue(mod in desc_sddl)
         self.sd_utils.modify_sd_on_dn(group_dn, "D:" + moded)
         desc_sddl = self.sd_utils.get_sd_as_sddl(group_dn)
@@ -1392,7 +1392,7 @@ class DaclDescriptorTests(DescriptorTests):
         # Make sure created group object contains only the above inherited ACE
         # that we've added manually
         desc_sddl = self.sd_utils.get_sd_as_sddl(group_dn)
-        mod = mod.replace(";CI;", ";CIID;") # change it how it's gonna look like
+        mod = mod.replace(";CI;", ";CIID;")  # change it how it's gonna look like
         self.assertTrue(mod in desc_sddl)
         self.sd_utils.modify_sd_on_dn(group_dn, "D:" + moded)
         desc_sddl = self.sd_utils.get_sd_as_sddl(group_dn)
@@ -1418,7 +1418,7 @@ class DaclDescriptorTests(DescriptorTests):
         # Make sure created group object contains only the above inherited ACE
         # that we've added manually
         desc_sddl = self.sd_utils.get_sd_as_sddl(group_dn)
-        mod = mod.replace(";OI;", ";OIIOID;") # change it how it's gonna look like
+        mod = mod.replace(";OI;", ";OIIOID;")  # change it how it's gonna look like
         self.assertTrue(mod in desc_sddl)
         self.sd_utils.modify_sd_on_dn(group_dn, "D:" + moded)
         desc_sddl = self.sd_utils.get_sd_as_sddl(group_dn)
@@ -1444,7 +1444,7 @@ class DaclDescriptorTests(DescriptorTests):
         # Make sure created group object contains only the above inherited ACE
         # that we've added manually
         desc_sddl = self.sd_utils.get_sd_as_sddl(group_dn)
-        mod = mod.replace(";CI;", ";CIID;") # change it how it's gonna look like
+        mod = mod.replace(";CI;", ";CIID;")  # change it how it's gonna look like
         self.assertTrue(mod in desc_sddl)
         self.sd_utils.modify_sd_on_dn(group_dn, "D:" + moded)
         desc_sddl = self.sd_utils.get_sd_as_sddl(group_dn)
@@ -1470,7 +1470,7 @@ class DaclDescriptorTests(DescriptorTests):
         # Make sure created group object contains only the above inherited ACE
         # that we've added manually
         desc_sddl = self.sd_utils.get_sd_as_sddl(group_dn)
-        mod = mod.replace(";OI;", ";OIIOID;") # change it how it's gonna look like
+        mod = mod.replace(";OI;", ";OIIOID;")  # change it how it's gonna look like
         self.assertTrue(mod in desc_sddl)
         self.sd_utils.modify_sd_on_dn(group_dn, "D:(OA;OI;WP;bf967a39-0de6-11d0-a285-00aa003049e2;;DU)" + moded)
         desc_sddl = self.sd_utils.get_sd_as_sddl(group_dn)
index f5ca6a3bc9f64a6499187103dea7c8bed3e571a7..17d3c960bdb42a4fa8fb0f4075551b5f3a27abbb 100755 (executable)
@@ -451,7 +451,7 @@ class SimpleSubnetTests(SitesBaseTests):
             # because it uses a inet_pton / inet_ntop round trip to
             # ascertain correctness.
 
-            "::ffff:0:0/96", #this one fails on WIN2012r2
+            "::ffff:0:0/96",  # this one fails on WIN2012r2
             "::ffff:aaaa:a000/120",
             "::ffff:10:0/120",
             "::ffff:2:300/120",
index 6a53e5bef6b74a82131ab98e7e56f0a67c5d9fce..e9f9b96538e90da1ac27b9efdb1f6fb8fd464cf0 100755 (executable)
@@ -115,7 +115,7 @@ class UserAccountControlTests(samba.tests.TestCase):
         creds_tmp.set_workstation(creds.get_workstation())
         creds_tmp.set_gensec_features(creds_tmp.get_gensec_features()
                                       | gensec.FEATURE_SEAL)
-        creds_tmp.set_kerberos_state(DONT_USE_KERBEROS) # kinit is too expensive to use in a tight loop
+        creds_tmp.set_kerberos_state(DONT_USE_KERBEROS)  # kinit is too expensive to use in a tight loop
         return creds_tmp
 
     def setUp(self):
index bdb0dd12461848db760e1c7fda8e5caeaa18e9f6..7da465b0b70622e909fed217817ff521634ad127 100644 (file)
@@ -9,7 +9,7 @@ new_instancemethod = new.instancemethod
 try:
     _swig_property = property
 except NameError:
-    pass # Python < 2.2 doesn't have 'property'.
+    pass  # Python < 2.2 doesn't have 'property'.
 def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
     if (name == "thisown"): return self.this.own(value)
     if (name == "this"):
index 092f204665403f8dcc54e0fe5f34eb7e326d5d5a..7df12ad14dd23bc0bba4ce4ee143911887dca89a 100644 (file)
@@ -192,7 +192,7 @@ class DrsCracknamesTestCase(drs_base.DrsBaseTestCase):
         names = drsuapi.DsNameString()
         names.str = name
 
-        req.codepage = 1252 # German, but it doesn't really matter here
+        req.codepage = 1252  # German, but it doesn't really matter here
         req.language = 1033
         req.format_flags = 0
         req.format_offered = format_offered
index 8bf3c1e0f65f45dbad59c1e779e98952e3113adb..0ecc0bc5051a364237fe71ec44e782ad0dc8e38d 100644 (file)
@@ -198,7 +198,7 @@ class DrsRodcTestCase(drs_base.DrsBaseTestCase):
             self.fail("Successfully replicated secrets to an RODC that shouldn't have been replicated.")
         except WERRORError as e:
             (enum, estr) = e.args
-            self.assertEquals(enum, 8630) # ERROR_DS_DRA_SECRETS_DENIED
+            self.assertEquals(enum, 8630)  # ERROR_DS_DRA_SECRETS_DENIED
 
         # send the same request again and we should get the same response
         try:
@@ -206,7 +206,7 @@ class DrsRodcTestCase(drs_base.DrsBaseTestCase):
             self.fail("Successfully replicated secrets to an RODC that shouldn't have been replicated.")
         except WERRORError as e1:
             (enum, estr) = e1.args
-            self.assertEquals(enum, 8630) # ERROR_DS_DRA_SECRETS_DENIED
+            self.assertEquals(enum, 8630)  # ERROR_DS_DRA_SECRETS_DENIED
 
         # Retry with Administrator credentials, ignores password replication groups
         (level, ctr) = self.drs.DsGetNCChanges(self.drs_handle, 10, req10)
@@ -511,7 +511,7 @@ class DrsRodcTestCase(drs_base.DrsBaseTestCase):
             self.fail("Successfully replicated secrets to an RODC that shouldn't have been replicated.")
         except WERRORError as e3:
             (enum, estr) = e3.args
-            self.assertEquals(enum, 8630) # ERROR_DS_DRA_SECRETS_DENIED
+            self.assertEquals(enum, 8630)  # ERROR_DS_DRA_SECRETS_DENIED
 
         req10 = self._getnc_req10(dest_dsa=str(self.rodc_ctx.ntds_guid),
                                   invocation_id=self.ldb_dc1.get_invocation_id(),
@@ -526,7 +526,7 @@ class DrsRodcTestCase(drs_base.DrsBaseTestCase):
             self.fail("Successfully replicated secrets to an RODC that shouldn't have been replicated.")
         except WERRORError as e4:
             (enum, estr) = e4.args
-            self.assertEquals(enum, 8630) # ERROR_DS_DRA_SECRETS_DENIED
+            self.assertEquals(enum, 8630)  # ERROR_DS_DRA_SECRETS_DENIED
 
     def test_msDSRevealedUsers_local_deny_allow(self):
         """
@@ -596,7 +596,7 @@ class DrsRodcTestCase(drs_base.DrsBaseTestCase):
             self.fail("Successfully replicated secrets to an RODC that shouldn't have been replicated.")
         except WERRORError as e5:
             (enum, estr) = e5.args
-            self.assertEquals(enum, 8630) # ERROR_DS_DRA_SECRETS_DENIED
+            self.assertEquals(enum, 8630)  # ERROR_DS_DRA_SECRETS_DENIED
 
         m = ldb.Message()
         m.dn = ldb.Dn(self.ldb_dc1, self.computer_dn)
@@ -613,7 +613,7 @@ class DrsRodcTestCase(drs_base.DrsBaseTestCase):
             self.fail("Successfully replicated secrets to an RODC that shouldn't have been replicated.")
         except WERRORError as e6:
             (enum, estr) = e6.args
-            self.assertEquals(enum, 8630) # ERROR_DS_DRA_SECRETS_DENIED
+            self.assertEquals(enum, 8630)  # ERROR_DS_DRA_SECRETS_DENIED
 
     def _assert_in_revealed_users(self, user_dn, attrlist):
         res = self.ldb_dc1.search(scope=ldb.SCOPE_BASE, base=self.computer_dn,
index 5a27c0edb86d1c621f91a3a31cef49f97cd3182f..0157fc73a9f32749a869736ca71f325c5f8e8f41 100755 (executable)
@@ -216,7 +216,7 @@ def test_dcpromo(t, vm):
                      "Last attempt .* was successful",
                      "CN=Configuration,${BASEDN}",
                      "Last attempt .* was successful",
-                     "CN=Configuration,${BASEDN}", # cope with either order
+                     "CN=Configuration,${BASEDN}",  # cope with either order
                      "Last attempt .* was successful",
                      "OUTBOUND NEIGHBORS",
                      "${BASEDN}",
index b3ef09066d8dc41085f680df0eb7dbcdc53c7f9d..d421369086aa9fc71dc346d3e0cdbad1a4759bef 100644 (file)
@@ -866,7 +866,7 @@ RebootOnCompletion=No
         i = child.expect(["You must restart this computer", "failed", "Active Directory Domain Services was not installed", "C:", pexpect.TIMEOUT], timeout=240)
         if i == 1 or i == 2:
             raise Exception("dcpromo failed")
-        if i == 4: # timeout
+        if i == 4:  # timeout
             child = self.open_telnet("${WIN_HOSTNAME}", "administrator", "${WIN_PASS}")
 
         child.sendline("shutdown -r -t 0")