PEP8: fix E231: missing whitespace after ','
authorJoe Guo <joeg@catalyst.net.nz>
Mon, 30 Jul 2018 06:19:05 +0000 (18:19 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Fri, 24 Aug 2018 05:49:28 +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>
78 files changed:
lib/ldb/tests/python/api.py
python/samba/ms_forest_updates_markdown.py
python/samba/ms_schema.py
python/samba/netcmd/__init__.py
python/samba/netcmd/dbcheck.py
python/samba/netcmd/dns.py
python/samba/netcmd/domain.py
python/samba/netcmd/drs.py
python/samba/netcmd/dsacl.py
python/samba/netcmd/gpo.py
python/samba/netcmd/ldapcmp.py
python/samba/netcmd/ntacl.py
python/samba/netcmd/user.py
python/samba/provision/__init__.py
python/samba/provision/backend.py
python/samba/provision/common.py
python/samba/schema.py
python/samba/sd_utils.py
python/samba/tests/common.py
python/samba/tests/dcerpc/raw_protocol.py
python/samba/tests/dcerpc/raw_testcase.py
python/samba/tests/dcerpc/rpcecho.py
python/samba/tests/docs.py
python/samba/tests/dsdb_lock.py
python/samba/tests/dsdb_schema_attributes.py
python/samba/tests/hostconfig.py
python/samba/tests/password_hash_fl2003.py
python/samba/tests/password_hash_fl2008.py
python/samba/tests/posixacl.py
python/samba/tests/samba3sam.py
python/samba/tests/samba_tool/dnscmd.py
python/samba/tests/samba_tool/forest.py
python/samba/tests/samba_tool/fsmo.py
python/samba/tests/samba_tool/group.py
python/samba/tests/samba_tool/join.py
python/samba/tests/samba_tool/ntacl.py
python/samba/tests/samba_tool/rodc.py
python/samba/tests/samba_tool/schema.py
python/samba/tests/samba_tool/user.py
python/samba/tests/security.py
python/samba/tests/smb.py
python/samba/tests/upgradeprovisionneeddc.py
python/samba/upgrade.py
python/samba/upgradehelpers.py
python/samba/web_server/__init__.py
script/autobuild.py
script/bisect-test.py
script/compare_cc_results.py
selftest/subunithelper.py
source3/script/tests/test_wbinfo_sids2xids_int.py
source3/selftest/tests.py
source4/dsdb/samdb/ldb_modules/tests/possibleinferiors.py
source4/dsdb/tests/python/acl.py
source4/dsdb/tests/python/deletetest.py
source4/dsdb/tests/python/dirsync.py
source4/dsdb/tests/python/dsdb_schema_info.py
source4/dsdb/tests/python/ldap.py
source4/dsdb/tests/python/ldap_schema.py
source4/dsdb/tests/python/ldap_syntaxes.py
source4/dsdb/tests/python/linked_attributes.py
source4/dsdb/tests/python/rodc_rwdc.py
source4/dsdb/tests/python/sam.py
source4/dsdb/tests/python/sec_descriptor.py
source4/dsdb/tests/python/urgent_replication.py
source4/dsdb/tests/python/user_account_control.py
source4/lib/wmi/wmi.py
source4/scripting/devel/repl_cleartext_pwd.py
source4/scripting/devel/speedtest.py
source4/selftest/tests.py
source4/torture/drs/python/delete_object.py
source4/torture/drs/python/drs_base.py
source4/torture/drs/python/fsmo.py
source4/torture/drs/python/getnc_exop.py
source4/torture/drs/python/repl_schema.py
source4/torture/drs/python/replica_sync.py
source4/torture/drs/python/replica_sync_rodc.py
source4/torture/drs/python/ridalloc_exop.py
wintest/wintest.py

index 643cacd0616e93cbdc501e16da834810ddef1caf..423b434d4d3fc27bfe27ef8b12b7e6e13cf3b747 100755 (executable)
@@ -346,7 +346,7 @@ class SimpleLdb(LdbBaseTest):
         m.dn = ldb.Dn(l, "dc=foo4")
         m["bla"] = b"bla"
         self.assertEqual(len(l.search()), 0)
         m.dn = ldb.Dn(l, "dc=foo4")
         m["bla"] = b"bla"
         self.assertEqual(len(l.search()), 0)
-        self.assertRaises(ldb.LdbError, lambda: l.add(m,["search_options:1:2"]))
+        self.assertRaises(ldb.LdbError, lambda: l.add(m, ["search_options:1:2"]))
 
     def test_add_dict(self):
         l = ldb.Ldb(self.url(), flags=self.flags())
 
     def test_add_dict(self):
         l = ldb.Ldb(self.url(), flags=self.flags())
@@ -682,7 +682,7 @@ class SimpleLdb(LdbBaseTest):
 
     def test_no_crash_broken_expr(self):
         l = ldb.Ldb(self.url(), flags=self.flags())
 
     def test_no_crash_broken_expr(self):
         l = ldb.Ldb(self.url(), flags=self.flags())
-        self.assertRaises(ldb.LdbError,lambda: l.search("", ldb.SCOPE_SUBTREE, "&(dc=*)(dn=*)", ["dc"]))
+        self.assertRaises(ldb.LdbError, lambda: l.search("", ldb.SCOPE_SUBTREE, "&(dc=*)(dn=*)", ["dc"]))
 
 # Run the SimpleLdb tests against an lmdb backend
 class SimpleLdbLmdb(SimpleLdb):
 
 # Run the SimpleLdb tests against an lmdb backend
 class SimpleLdbLmdb(SimpleLdb):
index 1b288e3e74cddb2e7f03d303a976292343050856..bd9924749679086058f1df972ea2a9babe402759 100644 (file)
@@ -217,7 +217,7 @@ def read_ms_markdown(in_file, out_folder=None, out_dict={}):
         if node.text and node.text.startswith('|Operation'):
             # Strip first and last |
             updates = [x[1:len(x) - 1].split('|') for x in
         if node.text and node.text.startswith('|Operation'):
             # Strip first and last |
             updates = [x[1:len(x) - 1].split('|') for x in
-                       ET.tostring(node,method='text').splitlines()]
+                       ET.tostring(node, method='text').splitlines()]
             for update in updates[2:]:
                 output = re.match('Operation (\d+): {(.*)}', update[0])
                 if output:
             for update in updates[2:]:
                 output = re.match('Operation (\d+): {(.*)}', update[0])
                 if output:
index cd7e5fb12f328574aedf6049d941d16e9150cd13..109c298cebc7687573795935b16c18caaf36196a 100644 (file)
@@ -83,8 +83,8 @@ oMObjectClassBER = {
 }
 
 # separated by commas in docs, and must be broken up
 }
 
 # separated by commas in docs, and must be broken up
-multivalued_attrs = set(["auxiliaryclass","maycontain","mustcontain","posssuperiors",
-                         "systemauxiliaryclass","systemmaycontain","systemmustcontain",
+multivalued_attrs = set(["auxiliaryclass", "maycontain", "mustcontain", "posssuperiors",
+                         "systemauxiliaryclass", "systemmaycontain", "systemmustcontain",
                          "systemposssuperiors"])
 
 def __read_folded_line(f, buffer):
                          "systemposssuperiors"])
 
 def __read_folded_line(f, buffer):
index 556afd71e400c16a7b272be7d99b437673ac76e8..cd1a23735501f6ce1e0d9b1a814c1ec48c6cd423 100644 (file)
@@ -28,7 +28,7 @@ class Option(optparse.Option):
 
 # This help formatter does text wrapping and preserves newlines
 class PlainHelpFormatter(optparse.IndentedHelpFormatter):
 
 # This help formatter does text wrapping and preserves newlines
 class PlainHelpFormatter(optparse.IndentedHelpFormatter):
-    def format_description(self,description=""):
+    def format_description(self, description=""):
         desc_width = self.width - self.current_indent
         indent = " " * self.current_indent
         paragraphs = description.split('\n')
         desc_width = self.width - self.current_indent
         indent = " " * self.current_indent
         paragraphs = description.split('\n')
@@ -128,7 +128,7 @@ class Command(object):
             usage=self.synopsis,
             description=self.full_description,
             formatter=PlainHelpFormatter(),
             usage=self.synopsis,
             description=self.full_description,
             formatter=PlainHelpFormatter(),
-            prog=prog,epilog=epilog)
+            prog=prog, epilog=epilog)
         parser.add_options(self.takes_options)
         optiongroups = {}
         for name, optiongroup in self.takes_optiongroups.items():
         parser.add_options(self.takes_options)
         optiongroups = {}
         for name, optiongroup in self.takes_optiongroups.items():
index 4e5e78d56684e2c9be5bac5b448d9be079b9b313..874b2f990d67b3e86bc8699d50c8bbfb960fcc10 100644 (file)
@@ -108,7 +108,7 @@ class cmd_dbcheck(Command):
             samdb_schema = SamDB(session_info=system_session(), url=None,
                                  credentials=creds, lp=lp)
 
             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)
         scope = scope.upper()
         if not scope in scope_map:
             raise CommandError("Unknown scope %s" % scope)
index cc65c9236dfefc0bebc533ea351d6ad7e703bb70..26c7551bc22480499eba5582e6b66a04d7919914 100644 (file)
@@ -549,7 +549,7 @@ class cmd_serverinfo(Command):
     takes_options = [
         Option('--client-version', help='Client Version',
                default='longhorn', metavar='w2k|dotnet|longhorn',
     takes_options = [
         Option('--client-version', help='Client Version',
                default='longhorn', metavar='w2k|dotnet|longhorn',
-               choices=['w2k','dotnet','longhorn'], dest='cli_ver'),
+               choices=['w2k', 'dotnet', 'longhorn'], dest='cli_ver'),
     ]
 
     def run(self, server, cli_ver, sambaopts=None, credopts=None,
     ]
 
     def run(self, server, cli_ver, sambaopts=None, credopts=None,
@@ -581,7 +581,7 @@ class cmd_zoneinfo(Command):
     takes_options = [
         Option('--client-version', help='Client Version',
                default='longhorn', metavar='w2k|dotnet|longhorn',
     takes_options = [
         Option('--client-version', help='Client Version',
                default='longhorn', metavar='w2k|dotnet|longhorn',
-               choices=['w2k','dotnet','longhorn'], dest='cli_ver'),
+               choices=['w2k', 'dotnet', 'longhorn'], dest='cli_ver'),
     ]
 
     def run(self, server, zone, cli_ver, sambaopts=None, credopts=None,
     ]
 
     def run(self, server, zone, cli_ver, sambaopts=None, credopts=None,
@@ -613,7 +613,7 @@ class cmd_zonelist(Command):
     takes_options = [
         Option('--client-version', help='Client Version',
                default='longhorn', metavar='w2k|dotnet|longhorn',
     takes_options = [
         Option('--client-version', help='Client Version',
                default='longhorn', metavar='w2k|dotnet|longhorn',
-               choices=['w2k','dotnet','longhorn'], dest='cli_ver'),
+               choices=['w2k', 'dotnet', 'longhorn'], dest='cli_ver'),
         Option('--primary', help='List primary zones (default)',
                action='store_true', dest='primary'),
         Option('--secondary', help='List secondary zones',
         Option('--primary', help='List primary zones (default)',
                action='store_true', dest='primary'),
         Option('--secondary', help='List secondary zones',
@@ -692,7 +692,7 @@ class cmd_zonecreate(Command):
     takes_options = [
         Option('--client-version', help='Client Version',
                default='longhorn', metavar='w2k|dotnet|longhorn',
     takes_options = [
         Option('--client-version', help='Client Version',
                default='longhorn', metavar='w2k|dotnet|longhorn',
-               choices=['w2k','dotnet','longhorn'], dest='cli_ver')
+               choices=['w2k', 'dotnet', 'longhorn'], dest='cli_ver')
     ]
 
     def run(self, server, zone, cli_ver, sambaopts=None, credopts=None,
     ]
 
     def run(self, server, zone, cli_ver, sambaopts=None, credopts=None,
@@ -923,7 +923,7 @@ class cmd_add_record(Command):
     def run(self, server, zone, name, rtype, data, sambaopts=None,
             credopts=None, versionopts=None):
 
     def run(self, server, zone, name, rtype, data, sambaopts=None,
             credopts=None, versionopts=None):
 
-        if rtype.upper() not in ('A','AAAA','PTR','CNAME','NS','MX','SRV','TXT'):
+        if rtype.upper() not in ('A', 'AAAA', 'PTR', 'CNAME', 'NS', 'MX', 'SRV', 'TXT'):
             raise CommandError('Adding record of type %s is not supported' % rtype)
 
         record_type = dns_type_flag(rtype)
             raise CommandError('Adding record of type %s is not supported' % rtype)
 
         record_type = dns_type_flag(rtype)
@@ -975,7 +975,7 @@ class cmd_update_record(Command):
     def run(self, server, zone, name, rtype, olddata, newdata,
             sambaopts=None, credopts=None, versionopts=None):
 
     def run(self, server, zone, name, rtype, olddata, newdata,
             sambaopts=None, credopts=None, versionopts=None):
 
-        if rtype.upper() not in ('A','AAAA','PTR','CNAME','NS','MX','SOA','SRV','TXT'):
+        if rtype.upper() not in ('A', 'AAAA', 'PTR', 'CNAME', 'NS', 'MX', 'SOA', 'SRV', 'TXT'):
             raise CommandError('Updating record of type %s is not supported' % rtype)
 
         record_type = dns_type_flag(rtype)
             raise CommandError('Updating record of type %s is not supported' % rtype)
 
         record_type = dns_type_flag(rtype)
@@ -1044,7 +1044,7 @@ class cmd_delete_record(Command):
 
     def run(self, server, zone, name, rtype, data, sambaopts=None, credopts=None, versionopts=None):
 
 
     def run(self, server, zone, name, rtype, data, sambaopts=None, credopts=None, versionopts=None):
 
-        if rtype.upper() not in ('A','AAAA','PTR','CNAME','NS','MX','SRV','TXT'):
+        if rtype.upper() not in ('A', 'AAAA', 'PTR', 'CNAME', 'NS', 'MX', 'SRV', 'TXT'):
             raise CommandError('Deleting record of type %s is not supported' % rtype)
 
         record_type = dns_type_flag(rtype)
             raise CommandError('Deleting record of type %s is not supported' % rtype)
 
         record_type = dns_type_flag(rtype)
index 19d522064e86a4ad8643260de1f71d7d651c7122..40117251450f90058a8ac358250d6182a6240ac5 100644 (file)
@@ -148,7 +148,7 @@ def get_testparm_var(testparm, smbconf, varname):
     p = subprocess.Popen([testparm, '-s', '-l',
                           '--parameter-name=%s' % varname, smbconf],
                          stdout=subprocess.PIPE, stderr=errfile)
     p = subprocess.Popen([testparm, '-s', '-l',
                           '--parameter-name=%s' % varname, smbconf],
                          stdout=subprocess.PIPE, stderr=errfile)
-    (out,err) = p.communicate()
+    (out, err) = p.communicate()
     errfile.close()
     lines = out.split('\n')
     if lines:
     errfile.close()
     lines = out.split('\n')
     if lines:
@@ -303,7 +303,7 @@ class cmd_domain_provision(Command):
     ]
 
     ntvfs_options = [
     ]
 
     ntvfs_options = [
-        Option("--use-xattrs", type="choice", choices=["yes","no","auto"],
+        Option("--use-xattrs", type="choice", choices=["yes", "no", "auto"],
                metavar="[yes|no|auto]",
                help="Define if we should use the native fs capabilities or a tdb file for "
                "storing attributes likes ntacl when --use-ntvfs is set. "
                metavar="[yes|no|auto]",
                help="Define if we should use the native fs capabilities or a tdb file for "
                "storing attributes likes ntacl when --use-ntvfs is set. "
@@ -1365,9 +1365,9 @@ class cmd_domain_passwordsettings_set(Command):
         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("-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("--complexity", type="choice", choices=["on","off","default"],
+        Option("--complexity", type="choice", choices=["on", "off", "default"],
                help="The password complexity (on | off | default). Default is 'on'"),
                help="The password complexity (on | off | default). Default is 'on'"),
-        Option("--store-plaintext", type="choice", choices=["on","off","default"],
+        Option("--store-plaintext", type="choice", choices=["on", "off", "default"],
                help="Store plaintext passwords where account have 'store passwords with reversible encryption' set (on | off | default). Default is 'off'"),
         Option("--history-length",
                help="The password history length (<integer> | default).  Default is 24.", type=str),
                help="Store plaintext passwords where account have 'store passwords with reversible encryption' set (on | off | default). Default is 'off'"),
         Option("--history-length",
                help="The password history length (<integer> | default).  Default is 24.", type=str),
@@ -1581,7 +1581,7 @@ class cmd_domain_classicupgrade(Command):
     ]
 
     ntvfs_options = [
     ]
 
     ntvfs_options = [
-        Option("--use-xattrs", type="choice", choices=["yes","no","auto"],
+        Option("--use-xattrs", type="choice", choices=["yes", "no", "auto"],
                metavar="[yes|no|auto]",
                help="Define if we should use the native fs capabilities or a tdb file for "
                "storing attributes likes ntacl when --use-ntvfs is set. "
                metavar="[yes|no|auto]",
                help="Define if we should use the native fs capabilities or a tdb file for "
                "storing attributes likes ntacl when --use-ntvfs is set. "
index 2d4ad9cd501e6d9e36f78876c4c20e9c4c070acf..e8dbdd432f6d80ebafff5637962a5e5a7161938d 100644 (file)
@@ -617,7 +617,7 @@ class cmd_drs_bind(Command):
             ("DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY_V2",   "DRS_EXT_ADDENTRY_V2"),
             ("DRSUAPI_SUPPORTED_EXTENSION_LINKED_VALUE_REPLICATION",   "DRS_EXT_LINKED_VALUE_REPLICATION"),
             ("DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V2",    "DRS_EXT_DCINFO_V2"),
             ("DRSUAPI_SUPPORTED_EXTENSION_ADDENTRY_V2",   "DRS_EXT_ADDENTRY_V2"),
             ("DRSUAPI_SUPPORTED_EXTENSION_LINKED_VALUE_REPLICATION",   "DRS_EXT_LINKED_VALUE_REPLICATION"),
             ("DRSUAPI_SUPPORTED_EXTENSION_DCINFO_V2",    "DRS_EXT_DCINFO_V2"),
-            ("DRSUAPI_SUPPORTED_EXTENSION_INSTANCE_TYPE_NOT_REQ_ON_MOD","DRS_EXT_INSTANCE_TYPE_NOT_REQ_ON_MOD"),
+            ("DRSUAPI_SUPPORTED_EXTENSION_INSTANCE_TYPE_NOT_REQ_ON_MOD", "DRS_EXT_INSTANCE_TYPE_NOT_REQ_ON_MOD"),
             ("DRSUAPI_SUPPORTED_EXTENSION_CRYPTO_BIND",   "DRS_EXT_CRYPTO_BIND"),
             ("DRSUAPI_SUPPORTED_EXTENSION_GET_REPL_INFO",   "DRS_EXT_GET_REPL_INFO"),
             ("DRSUAPI_SUPPORTED_EXTENSION_STRONG_ENCRYPTION",   "DRS_EXT_STRONG_ENCRYPTION"),
             ("DRSUAPI_SUPPORTED_EXTENSION_CRYPTO_BIND",   "DRS_EXT_CRYPTO_BIND"),
             ("DRSUAPI_SUPPORTED_EXTENSION_GET_REPL_INFO",   "DRS_EXT_GET_REPL_INFO"),
             ("DRSUAPI_SUPPORTED_EXTENSION_STRONG_ENCRYPTION",   "DRS_EXT_STRONG_ENCRYPTION"),
index 7522736b125b16383832f69f6df19ad7876402d5..4ca15cdc99da9b08a92ce0f0877e26d4d3f4ad23 100644 (file)
@@ -87,7 +87,7 @@ class cmd_dsacl_set(Command):
         res = samdb.search(base=trusteedn, expression="(objectClass=*)",
                            scope=SCOPE_BASE)
         assert(len(res) == 1)
         res = samdb.search(base=trusteedn, expression="(objectClass=*)",
                            scope=SCOPE_BASE)
         assert(len(res) == 1)
-        return ndr_unpack(security.dom_sid,res[0]["objectSid"][0])
+        return ndr_unpack(security.dom_sid, res[0]["objectSid"][0])
 
     def modify_descriptor(self, samdb, object_dn, desc, controls=None):
         assert(isinstance(desc, security.descriptor))
 
     def modify_descriptor(self, samdb, object_dn, desc, controls=None):
         assert(isinstance(desc, security.descriptor))
@@ -109,7 +109,7 @@ class cmd_dsacl_set(Command):
     def get_domain_sid(self, samdb):
         res = samdb.search(base=samdb.domain_dn(),
                            expression="(objectClass=*)", scope=SCOPE_BASE)
     def get_domain_sid(self, samdb):
         res = samdb.search(base=samdb.domain_dn(),
                            expression="(objectClass=*)", scope=SCOPE_BASE)
-        return ndr_unpack(security.dom_sid,res[0]["objectSid"][0])
+        return ndr_unpack(security.dom_sid, res[0]["objectSid"][0])
 
     def add_ace(self, samdb, object_dn, new_ace):
         """Add new ace explicitly."""
 
     def add_ace(self, samdb, object_dn, new_ace):
         """Add new ace explicitly."""
index c5e322342ad9ba31e8f10de38f48dcd7314c610e..06b4fe508b9576a97d9961dcd099998f8a8563a0 100644 (file)
@@ -432,7 +432,7 @@ class cmd_list(Command):
 
         try:
             msg = self.samdb.search(expression='(&(|(samAccountName=%s)(samAccountName=%s$))(objectClass=User))' %
 
         try:
             msg = self.samdb.search(expression='(&(|(samAccountName=%s)(samAccountName=%s$))(objectClass=User))' %
-                                    (ldb.binary_encode(username),ldb.binary_encode(username)))
+                                    (ldb.binary_encode(username), ldb.binary_encode(username)))
             user_dn = msg[0].dn
         except Exception:
             raise CommandError("Failed to find account %s" % username)
             user_dn = msg[0].dn
         except Exception:
             raise CommandError("Failed to find account %s" % username)
index ea2c2ae4cca941990012b6d96e28d26018bb24c4..3f4d63d989f07ba395a5ec471b01943c062da009 100644 (file)
@@ -97,7 +97,7 @@ class LDAPBase(object):
 
     def find_domain_sid(self):
         res = self.ldb.search(base=self.base_dn, expression="(objectClass=*)", scope=SCOPE_BASE)
 
     def find_domain_sid(self):
         res = self.ldb.search(base=self.base_dn, expression="(objectClass=*)", scope=SCOPE_BASE)
-        return ndr_unpack(security.dom_sid,res[0]["objectSid"][0])
+        return ndr_unpack(security.dom_sid, res[0]["objectSid"][0])
 
     def find_servers(self):
         """
 
     def find_servers(self):
         """
@@ -492,19 +492,19 @@ class LDAPObject(object):
             # Attributes that contain the Domain name e.g. 'samba.org'
             self.domain_attributes = [
                 "proxyAddresses", "mail", "userPrincipalName", "msExchSmtpFullyQualifiedDomainName",
             # Attributes that contain the Domain name e.g. 'samba.org'
             self.domain_attributes = [
                 "proxyAddresses", "mail", "userPrincipalName", "msExchSmtpFullyQualifiedDomainName",
-                "dnsHostName", "networkAddress", "dnsRoot", "servicePrincipalName",]
+                "dnsHostName", "networkAddress", "dnsRoot", "servicePrincipalName", ]
             self.domain_attributes = [x.upper() for x in self.domain_attributes]
             #
             # May contain DOMAIN_NETBIOS and SERVER_NAME
             self.servername_attributes = ["distinguishedName", "name", "CN", "sAMAccountName", "dNSHostName",
                                            "servicePrincipalName", "rIDSetReferences", "serverReference", "serverReferenceBL",
             self.domain_attributes = [x.upper() for x in self.domain_attributes]
             #
             # May contain DOMAIN_NETBIOS and SERVER_NAME
             self.servername_attributes = ["distinguishedName", "name", "CN", "sAMAccountName", "dNSHostName",
                                            "servicePrincipalName", "rIDSetReferences", "serverReference", "serverReferenceBL",
-                                           "msDS-IsDomainFor", "interSiteTopologyGenerator",]
+                                           "msDS-IsDomainFor", "interSiteTopologyGenerator", ]
             self.servername_attributes = [x.upper() for x in self.servername_attributes]
             #
             self.servername_attributes = [x.upper() for x in self.servername_attributes]
             #
-            self.netbios_attributes = ["servicePrincipalName", "CN", "distinguishedName", "nETBIOSName", "name",]
+            self.netbios_attributes = ["servicePrincipalName", "CN", "distinguishedName", "nETBIOSName", "name", ]
             self.netbios_attributes = [x.upper() for x in self.netbios_attributes]
             #
             self.netbios_attributes = [x.upper() for x in self.netbios_attributes]
             #
-            self.other_attributes = ["name", "DC",]
+            self.other_attributes = ["name", "DC", ]
             self.other_attributes = [x.upper() for x in self.other_attributes]
         #
         self.ignore_attributes = [x.upper() for x in self.ignore_attributes]
             self.other_attributes = [x.upper() for x in self.other_attributes]
         #
         self.ignore_attributes = [x.upper() for x in self.ignore_attributes]
@@ -968,7 +968,7 @@ class cmd_ldapcmp(Command):
 
         con1 = LDAPBase(URL1, creds, lp,
                         two=two, quiet=quiet, descriptor=descriptor, sort_aces=sort_aces,
 
         con1 = LDAPBase(URL1, creds, lp,
                         two=two, quiet=quiet, descriptor=descriptor, sort_aces=sort_aces,
-                        verbose=verbose,view=view, base=base, scope=scope,
+                        verbose=verbose, view=view, base=base, scope=scope,
                         outf=self.outf, errf=self.errf)
         assert len(con1.base_dn) > 0
 
                         outf=self.outf, errf=self.errf)
         assert len(con1.base_dn) > 0
 
index 3957a726689cb84611951c146df7cdd91d1ddfe7..e7f410382c46dc44f37a06c6e00cb5a2be0c2589 100644 (file)
@@ -19,7 +19,7 @@
 from samba.credentials import DONT_USE_KERBEROS
 import samba.getopt as options
 from samba.dcerpc import security, idmap
 from samba.credentials import DONT_USE_KERBEROS
 import samba.getopt as options
 from samba.dcerpc import security, idmap
-from samba.ntacls import setntacl, getntacl,getdosinfo
+from samba.ntacls import setntacl, getntacl, getdosinfo
 from samba import Ldb
 from samba.ndr import ndr_unpack, ndr_print
 from samba.samdb import SamDB
 from samba import Ldb
 from samba.ndr import ndr_unpack, ndr_print
 from samba.samdb import SamDB
@@ -53,17 +53,17 @@ class cmd_ntacl_set(Command):
     takes_options = [
         Option("-q", "--quiet", help="Be quiet", action="store_true"),
         Option("--xattr-backend", type="choice", help="xattr backend type (native fs or tdb)",
     takes_options = [
         Option("-q", "--quiet", help="Be quiet", action="store_true"),
         Option("--xattr-backend", type="choice", help="xattr backend type (native fs or tdb)",
-               choices=["native","tdb"]),
+               choices=["native", "tdb"]),
         Option("--eadb-file", help="Name of the tdb file where attributes are stored", type="string"),
         Option("--use-ntvfs", help="Set the ACLs directly to the TDB or xattr for use with the ntvfs file server", action="store_true"),
         Option("--use-s3fs", help="Set the ACLs for use with the default s3fs file server via the VFS layer", action="store_true"),
         Option("--service", help="Name of the smb.conf service to use when applying the ACLs", type="string")
     ]
 
         Option("--eadb-file", help="Name of the tdb file where attributes are stored", type="string"),
         Option("--use-ntvfs", help="Set the ACLs directly to the TDB or xattr for use with the ntvfs file server", action="store_true"),
         Option("--use-s3fs", help="Set the ACLs for use with the default s3fs file server via the VFS layer", action="store_true"),
         Option("--service", help="Name of the smb.conf service to use when applying the ACLs", type="string")
     ]
 
-    takes_args = ["acl","file"]
+    takes_args = ["acl", "file"]
 
     def run(self, acl, file, use_ntvfs=False, use_s3fs=False,
 
     def run(self, acl, file, use_ntvfs=False, use_s3fs=False,
-            quiet=False,xattr_backend=None,eadb_file=None,
+            quiet=False, xattr_backend=None, eadb_file=None,
             credopts=None, sambaopts=None, versionopts=None,
             service=None):
         logger = self.get_logger()
             credopts=None, sambaopts=None, versionopts=None,
             service=None):
         logger = self.get_logger()
@@ -129,7 +129,7 @@ class cmd_ntacl_get(Command):
     takes_options = [
         Option("--as-sddl", help="Output ACL in the SDDL format", action="store_true"),
         Option("--xattr-backend", type="choice", help="xattr backend type (native fs or tdb)",
     takes_options = [
         Option("--as-sddl", help="Output ACL in the SDDL format", action="store_true"),
         Option("--xattr-backend", type="choice", help="xattr backend type (native fs or tdb)",
-               choices=["native","tdb"]),
+               choices=["native", "tdb"]),
         Option("--eadb-file", help="Name of the tdb file where attributes are stored", type="string"),
         Option("--use-ntvfs", help="Get the ACLs directly from the TDB or xattr used with the ntvfs file server", action="store_true"),
         Option("--use-s3fs", help="Get the ACLs for use via the VFS layer used by the default s3fs file server", action="store_true"),
         Option("--eadb-file", help="Name of the tdb file where attributes are stored", type="string"),
         Option("--use-ntvfs", help="Get the ACLs directly from the TDB or xattr used with the ntvfs file server", action="store_true"),
         Option("--use-s3fs", help="Get the ACLs for use via the VFS layer used by the default s3fs file server", action="store_true"),
@@ -223,10 +223,10 @@ class cmd_ntacl_sysvolreset(Command):
         # These assertions correct for current ad_dc selftest
         # configuration.  When other environments have a broad range of
         # groups mapped via passdb, we can relax some of these checks
         # These assertions correct for current ad_dc selftest
         # configuration.  When other environments have a broad range of
         # groups mapped via passdb, we can relax some of these checks
-        (LA_uid,LA_type) = s4_passdb.sid_to_id(LA_sid)
+        (LA_uid, LA_type) = s4_passdb.sid_to_id(LA_sid)
         if (LA_type != idmap.ID_TYPE_UID and LA_type != idmap.ID_TYPE_BOTH):
             raise CommandError("SID %s is not mapped to a UID" % LA_sid)
         if (LA_type != idmap.ID_TYPE_UID and LA_type != idmap.ID_TYPE_BOTH):
             raise CommandError("SID %s is not mapped to a UID" % LA_sid)
-        (BA_gid,BA_type) = s4_passdb.sid_to_id(BA_sid)
+        (BA_gid, BA_type) = s4_passdb.sid_to_id(BA_sid)
         if (BA_type != idmap.ID_TYPE_GID and BA_type != idmap.ID_TYPE_BOTH):
             raise CommandError("SID %s is not mapped to a GID" % BA_sid)
 
         if (BA_type != idmap.ID_TYPE_GID and BA_type != idmap.ID_TYPE_BOTH):
             raise CommandError("SID %s is not mapped to a GID" % BA_sid)
 
index d83a7db7ecd6b441c9dcaff4fea6b1130d96a573..677e0a91559dac4d30cfc8a9be428424d4eadfcf 100644 (file)
@@ -1857,7 +1857,7 @@ samba-tool user syncpasswords --terminate \\
                 self.samdb_url = H
                 self.dirsync_filter = dirsync_filter
                 self.dirsync_attrs = dirsync_attrs
                 self.samdb_url = H
                 self.dirsync_filter = dirsync_filter
                 self.dirsync_attrs = dirsync_attrs
-                self.dirsync_controls = ["dirsync:1:0:0","extended_dn:1:0"];
+                self.dirsync_controls = ["dirsync:1:0:0", "extended_dn:1:0"];
                 self.password_attrs = password_attrs
                 self.decrypt_samba_gpg = decrypt_samba_gpg
                 self.sync_command = sync_command
                 self.password_attrs = password_attrs
                 self.decrypt_samba_gpg = decrypt_samba_gpg
                 self.sync_command = sync_command
@@ -1881,7 +1881,7 @@ samba-tool user syncpasswords --terminate \\
                 self.current_pid = None
                 self.outf.write("Initialized cache_ldb[%s]\n" % (cache_ldb))
                 msgs = self.cache.parse_ldif(add_ldif)
                 self.current_pid = None
                 self.outf.write("Initialized cache_ldb[%s]\n" % (cache_ldb))
                 msgs = self.cache.parse_ldif(add_ldif)
-                changetype,msg = next(msgs)
+                changetype, msg = next(msgs)
                 ldif = self.cache.write_ldif(msg, ldb.CHANGETYPE_NONE)
                 self.outf.write("%s" % ldif)
             else:
                 ldif = self.cache.write_ldif(msg, ldb.CHANGETYPE_NONE)
                 self.outf.write("%s" % ldif)
             else:
@@ -2079,7 +2079,7 @@ samba-tool user syncpasswords --terminate \\
             assert len(res_controls) > 0
             assert res_controls[0].oid == "1.2.840.113556.1.4.841"
             res_controls[0].critical = True
             assert len(res_controls) > 0
             assert res_controls[0].oid == "1.2.840.113556.1.4.841"
             res_controls[0].critical = True
-            self.dirsync_controls = [str(res_controls[0]),"extended_dn:1:0"]
+            self.dirsync_controls = [str(res_controls[0]), "extended_dn:1:0"]
             log_msg("dirsyncControls: %r\n" % self.dirsync_controls)
 
             modify_ldif = "dn: %s\n" % (self.cache_dn)
             log_msg("dirsyncControls: %r\n" % self.dirsync_controls)
 
             modify_ldif = "dn: %s\n" % (self.cache_dn)
index a4f808ccd4a697df96363079a5f7a5ead8e8f7bf..5af894d47911e5108f9d276cf9c39fed4cfba9e5 100644 (file)
@@ -204,9 +204,9 @@ def find_provision_key_parameters(samdb, secretsdb, idmapdb, paths, smbconf,
     # netbiosname
     # Get the netbiosname first (could be obtained from smb.conf in theory)
     res = secretsdb.search(expression="(flatname=%s)" %
     # netbiosname
     # Get the netbiosname first (could be obtained from smb.conf in theory)
     res = secretsdb.search(expression="(flatname=%s)" %
-                           names.domain,base="CN=Primary Domains",
+                           names.domain, base="CN=Primary Domains",
                            scope=ldb.SCOPE_SUBTREE, attrs=["sAMAccountName"])
                            scope=ldb.SCOPE_SUBTREE, attrs=["sAMAccountName"])
-    names.netbiosname = str(res[0]["sAMAccountName"]).replace("$","")
+    names.netbiosname = str(res[0]["sAMAccountName"]).replace("$", "")
 
     names.smbconf = smbconf
 
 
     names.smbconf = smbconf
 
@@ -215,7 +215,7 @@ def find_provision_key_parameters(samdb, secretsdb, idmapdb, paths, smbconf,
     current = samdb.search(expression="(objectClass=*)",
                            base="", scope=ldb.SCOPE_BASE,
                            attrs=["defaultNamingContext", "schemaNamingContext",
     current = samdb.search(expression="(objectClass=*)",
                            base="", scope=ldb.SCOPE_BASE,
                            attrs=["defaultNamingContext", "schemaNamingContext",
-                                  "configurationNamingContext","rootDomainNamingContext",
+                                  "configurationNamingContext", "rootDomainNamingContext",
                                   "namingContexts"])
 
     names.configdn = current[0]["configurationNamingContext"][0]
                                   "namingContexts"])
 
     names.configdn = current[0]["configurationNamingContext"][0]
@@ -275,7 +275,7 @@ def find_provision_key_parameters(samdb, secretsdb, idmapdb, paths, smbconf,
     # domain guid/sid
     res6 = samdb.search(expression="(objectClass=*)", base=basedn,
                         scope=ldb.SCOPE_BASE, attrs=["objectGUID",
     # domain guid/sid
     res6 = samdb.search(expression="(objectClass=*)", base=basedn,
                         scope=ldb.SCOPE_BASE, attrs=["objectGUID",
-                                                     "objectSid","msDS-Behavior-Version"])
+                                                     "objectSid", "msDS-Behavior-Version"])
     names.domainguid = str(ndr_unpack(misc.GUID, res6[0]["objectGUID"][0]))
     names.domainsid = ndr_unpack(security.dom_sid, res6[0]["objectSid"][0])
     names.forestsid = ndr_unpack(security.dom_sid, res6[0]["objectSid"][0])
     names.domainguid = str(ndr_unpack(misc.GUID, res6[0]["objectGUID"][0]))
     names.domainsid = ndr_unpack(security.dom_sid, res6[0]["objectSid"][0])
     names.forestsid = ndr_unpack(security.dom_sid, res6[0]["objectSid"][0])
@@ -288,15 +288,15 @@ def find_provision_key_parameters(samdb, secretsdb, idmapdb, paths, smbconf,
     # policy guid
     res7 = samdb.search(expression="(name={%s})" % DEFAULT_POLICY_GUID,
                         base="CN=Policies,CN=System," + basedn,
     # policy guid
     res7 = samdb.search(expression="(name={%s})" % DEFAULT_POLICY_GUID,
                         base="CN=Policies,CN=System," + basedn,
-                        scope=ldb.SCOPE_ONELEVEL, attrs=["cn","displayName"])
-    names.policyid = str(res7[0]["cn"]).replace("{","").replace("}","")
+                        scope=ldb.SCOPE_ONELEVEL, attrs=["cn", "displayName"])
+    names.policyid = str(res7[0]["cn"]).replace("{", "").replace("}", "")
     # dc policy guid
     res8 = samdb.search(expression="(name={%s})" % DEFAULT_DC_POLICY_GUID,
                         base="CN=Policies,CN=System," + basedn,
                         scope=ldb.SCOPE_ONELEVEL,
     # dc policy guid
     res8 = samdb.search(expression="(name={%s})" % DEFAULT_DC_POLICY_GUID,
                         base="CN=Policies,CN=System," + basedn,
                         scope=ldb.SCOPE_ONELEVEL,
-                        attrs=["cn","displayName"])
+                        attrs=["cn", "displayName"])
     if len(res8) == 1:
     if len(res8) == 1:
-        names.policyid_dc = str(res8[0]["cn"]).replace("{","").replace("}","")
+        names.policyid_dc = str(res8[0]["cn"]).replace("{", "").replace("}", "")
     else:
         names.policyid_dc = None
 
     else:
         names.policyid_dc = None
 
@@ -407,7 +407,7 @@ def set_provision_usn(samdb, low, high, id):
     samdb.add(delta)
 
 
     samdb.add(delta)
 
 
-def get_max_usn(samdb,basedn):
+def get_max_usn(samdb, basedn):
     """ This function return the biggest USN present in the provision
 
     :param samdb: A LDB object pointing to the sam.ldb
     """ This function return the biggest USN present in the provision
 
     :param samdb: A LDB object pointing to the sam.ldb
@@ -415,8 +415,8 @@ def get_max_usn(samdb,basedn):
                     (ie. DC=foo, DC=bar)
     :return: The biggest USN in the provision"""
 
                     (ie. DC=foo, DC=bar)
     :return: The biggest USN in the provision"""
 
-    res = samdb.search(expression="objectClass=*",base=basedn,
-                       scope=ldb.SCOPE_SUBTREE,attrs=["uSNChanged"],
+    res = samdb.search(expression="objectClass=*", base=basedn,
+                       scope=ldb.SCOPE_SUBTREE, attrs=["uSNChanged"],
                        controls=["search_options:1:2",
                                  "server_sort:1:1:uSNChanged",
                                  "paged_results:1:1"])
                        controls=["search_options:1:2",
                                  "server_sort:1:1:uSNChanged",
                                  "paged_results:1:1"])
@@ -1264,10 +1264,10 @@ def create_default_gpo(sysvolpath, dnsdomain, policyguid, policyguid_dc):
     :param policyguid: GUID of the default domain policy
     :param policyguid_dc: GUID of the default domain controler policy
     """
     :param policyguid: GUID of the default domain policy
     :param policyguid_dc: GUID of the default domain controler policy
     """
-    policy_path = getpolicypath(sysvolpath,dnsdomain,policyguid)
+    policy_path = getpolicypath(sysvolpath, dnsdomain, policyguid)
     create_gpo_struct(policy_path)
 
     create_gpo_struct(policy_path)
 
-    policy_path = getpolicypath(sysvolpath,dnsdomain,policyguid_dc)
+    policy_path = getpolicypath(sysvolpath, dnsdomain, policyguid_dc)
     create_gpo_struct(policy_path)
 
 
     create_gpo_struct(policy_path)
 
 
index d85072a8723161e8aa0b5ac61dfa79998e67aa93..e2e372e8b59a60f0510afb9162ae5922820c8621 100644 (file)
@@ -403,7 +403,7 @@ class OpenLDAPBackend(LDAPBackend):
             # For now, make these equal
             mmr_pass = self.ldapadminpass
 
             # For now, make these equal
             mmr_pass = self.ldapadminpass
 
-            url_list = filter(None,self.ol_mmr_urls.split(','))
+            url_list = filter(None, self.ol_mmr_urls.split(','))
             for url in url_list:
                 self.logger.info("Using LDAP-URL: " + url)
             if len(url_list) == 1:
             for url in url_list:
                 self.logger.info("Using LDAP-URL: " + url)
             if len(url_list) == 1:
@@ -512,7 +512,7 @@ class OpenLDAPBackend(LDAPBackend):
                     "REFINT_CONFIG": refint_config,
                     "INDEX_CONFIG": index_config,
                     "ADMIN_UID": str(os.getuid()),
                     "REFINT_CONFIG": refint_config,
                     "INDEX_CONFIG": index_config,
                     "ADMIN_UID": str(os.getuid()),
-                    "NOSYNC": nosync_config,})
+                    "NOSYNC": nosync_config, })
 
         self.setup_db_dir(os.path.join(self.ldapdir, "db", "forestdns"))
         self.setup_db_dir(os.path.join(self.ldapdir, "db", "domaindns"))
 
         self.setup_db_dir(os.path.join(self.ldapdir, "db", "forestdns"))
         self.setup_db_dir(os.path.join(self.ldapdir, "db", "domaindns"))
index 03e22789515cb338eaebf2c117d8ee56e7793695..2f95492d33ae730280e002da15d07fbf1e7385ff 100644 (file)
@@ -42,7 +42,7 @@ def setup_path(file):
     return os.path.join(setup_dir(), file)
 
 
     return os.path.join(setup_dir(), file)
 
 
-def setup_add_ldif(ldb, ldif_path, subst_vars=None,controls=["relax:0"]):
+def setup_add_ldif(ldb, ldif_path, subst_vars=None, controls=["relax:0"]):
     """Setup a ldb in the private dir.
 
     :param ldb: LDB file to import data into
     """Setup a ldb in the private dir.
 
     :param ldb: LDB file to import data into
@@ -55,7 +55,7 @@ def setup_add_ldif(ldb, ldif_path, subst_vars=None,controls=["relax:0"]):
     ldb.add_ldif(data, controls)
 
 
     ldb.add_ldif(data, controls)
 
 
-def setup_modify_ldif(ldb, ldif_path, subst_vars=None,controls=["relax:0"]):
+def setup_modify_ldif(ldb, ldif_path, subst_vars=None, controls=["relax:0"]):
     """Modify a ldb in the private dir.
 
     :param ldb: LDB object.
     """Modify a ldb in the private dir.
 
     :param ldb: LDB object.
index 0958808cc889c945d93520ddd19ef6cc9aab028f..55cb52e0fc4b648c203e81f1ab8e1132a9af8b23 100644 (file)
@@ -219,7 +219,7 @@ def get_linked_attributes(schemadn, schemaldb):
     return attributes
 
 
     return attributes
 
 
-def get_dnsyntax_attributes(schemadn,schemaldb):
+def get_dnsyntax_attributes(schemadn, schemaldb):
     res = schemaldb.search(
         expression="(&(!(linkID=*))(objectclass=attributeSchema)(attributeSyntax=2.5.5.1))",
         base=schemadn, scope=SCOPE_ONELEVEL,
     res = schemaldb.search(
         expression="(&(!(linkID=*))(objectclass=attributeSchema)(attributeSyntax=2.5.5.1))",
         base=schemadn, scope=SCOPE_ONELEVEL,
index aebb2cabc4bbfdb0c108ba70d00aa229d4701f73..26e80ee2f4ac6d4bc434b364055e1da96b249a3a 100644 (file)
@@ -66,7 +66,7 @@ class SDUtils(object):
     def dacl_add_ace(self, object_dn, ace):
         """Add an ACE to an objects security descriptor
         """
     def dacl_add_ace(self, object_dn, ace):
         """Add an ACE to an objects security descriptor
         """
-        desc = self.read_sd_on_dn(object_dn,["show_deleted:1"])
+        desc = self.read_sd_on_dn(object_dn, ["show_deleted:1"])
         desc_sddl = desc.as_sddl(self.domain_sid)
         if ace in desc_sddl:
             return
         desc_sddl = desc.as_sddl(self.domain_sid)
         if ace in desc_sddl:
             return
index 49ae2b07a786f3ae3d0aca0ac3112d30bde586e2..146c6a8de9da7e84676cd75639dc5b495e4c24fc 100644 (file)
@@ -50,13 +50,13 @@ class CommonTests(samba.tests.TestCaseInTempDir):
             dn4 = dsdb_Dn(sam, "B:8:00000000:<GUID=ffffffff-17f4-452a-b002-963e1909d101>;OU=dn4,DC=samba,DC=example,DC=com")
             dn5 = dsdb_Dn(sam, "<GUID=ffffffff-27f4-452a-b002-963e1909d101>;OU=dn5,DC=samba,DC=example,DC=com")
             dn6 = dsdb_Dn(sam, "<GUID=00000000-27f4-452a-b002-963e1909d101>;OU=dn6,DC=samba,DC=example,DC=com")
             dn4 = dsdb_Dn(sam, "B:8:00000000:<GUID=ffffffff-17f4-452a-b002-963e1909d101>;OU=dn4,DC=samba,DC=example,DC=com")
             dn5 = dsdb_Dn(sam, "<GUID=ffffffff-27f4-452a-b002-963e1909d101>;OU=dn5,DC=samba,DC=example,DC=com")
             dn6 = dsdb_Dn(sam, "<GUID=00000000-27f4-452a-b002-963e1909d101>;OU=dn6,DC=samba,DC=example,DC=com")
-            unsorted_links14 = [dn1,dn2,dn3,dn4]
+            unsorted_links14 = [dn1, dn2, dn3, dn4]
             sorted_vals14 = [str(dn) for dn in sorted(unsorted_links14)]
             self.assertEquals(sorted_vals14[0], str(dn3))
             self.assertEquals(sorted_vals14[1], str(dn2))
             self.assertEquals(sorted_vals14[2], str(dn1))
             self.assertEquals(sorted_vals14[3], str(dn4))
             sorted_vals14 = [str(dn) for dn in sorted(unsorted_links14)]
             self.assertEquals(sorted_vals14[0], str(dn3))
             self.assertEquals(sorted_vals14[1], str(dn2))
             self.assertEquals(sorted_vals14[2], str(dn1))
             self.assertEquals(sorted_vals14[3], str(dn4))
-            unsorted_links56 = [dn5,dn6]
+            unsorted_links56 = [dn5, dn6]
             sorted_vals56 = [str(dn) for dn in sorted(unsorted_links56)]
             self.assertEquals(sorted_vals56[0], str(dn6))
             self.assertEquals(sorted_vals56[1], str(dn5))
             sorted_vals56 = [str(dn) for dn in sorted(unsorted_links56)]
             self.assertEquals(sorted_vals56[0], str(dn6))
             self.assertEquals(sorted_vals56[1], str(dn5))
index 3f6e05b0ae0ca5f6affa927e2f3857a4564f302e..2659b755ef76afd158922a628712e687c4c39700 100755 (executable)
@@ -800,7 +800,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
 
         # With a known but wrong syntax we get a protocol error
         # see test_no_auth_presentation_ctx_valid2
 
         # With a known but wrong syntax we get a protocol error
         # see test_no_auth_presentation_ctx_valid2
-        tsf1b_list = [zero_syntax,samba.dcerpc.epmapper.abstract_syntax(),ndr64]
+        tsf1b_list = [zero_syntax, samba.dcerpc.epmapper.abstract_syntax(), ndr64]
         ctx1b = dcerpc.ctx_list()
         ctx1b.context_id = 1
         ctx1b.num_transfer_syntaxes = len(tsf1b_list)
         ctx1b = dcerpc.ctx_list()
         ctx1b.context_id = 1
         ctx1b.num_transfer_syntaxes = len(tsf1b_list)
@@ -862,7 +862,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
 
         # With a unknown but wrong syntaxes we get NO protocol error
         # see test_no_auth_presentation_ctx_invalid4
 
         # With a unknown but wrong syntaxes we get NO protocol error
         # see test_no_auth_presentation_ctx_invalid4
-        tsf1b_list = [zero_syntax,samba.dcerpc.epmapper.abstract_syntax()]
+        tsf1b_list = [zero_syntax, samba.dcerpc.epmapper.abstract_syntax()]
         ctx1b = dcerpc.ctx_list()
         ctx1b.context_id = 1
         ctx1b.num_transfer_syntaxes = len(tsf1b_list)
         ctx1b = dcerpc.ctx_list()
         ctx1b.context_id = 1
         ctx1b.num_transfer_syntaxes = len(tsf1b_list)
@@ -977,7 +977,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
         self.assertEquals(rep.u.cancel_count, 0)
         self.assertGreaterEqual(len(rep.u.stub_and_verifier), rep.u.alloc_hint)
 
         self.assertEquals(rep.u.cancel_count, 0)
         self.assertGreaterEqual(len(rep.u.stub_and_verifier), rep.u.alloc_hint)
 
-        tsf1_list = [zero_syntax,ndr32]
+        tsf1_list = [zero_syntax, ndr32]
         ctx1 = dcerpc.ctx_list()
         ctx1.context_id = 1
         ctx1.num_transfer_syntaxes = len(tsf1_list)
         ctx1 = dcerpc.ctx_list()
         ctx1.context_id = 1
         ctx1.num_transfer_syntaxes = len(tsf1_list)
@@ -1016,7 +1016,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
         self.assertEquals(rep.u.cancel_count, 0)
         self.assertGreaterEqual(len(rep.u.stub_and_verifier), rep.u.alloc_hint)
 
         self.assertEquals(rep.u.cancel_count, 0)
         self.assertGreaterEqual(len(rep.u.stub_and_verifier), rep.u.alloc_hint)
 
-        tsf2_list = [ndr32,ndr32]
+        tsf2_list = [ndr32, ndr32]
         ctx2 = dcerpc.ctx_list()
         ctx2.context_id = 2
         ctx2.num_transfer_syntaxes = len(tsf2_list)
         ctx2 = dcerpc.ctx_list()
         ctx2.context_id = 2
         ctx2.num_transfer_syntaxes = len(tsf2_list)
@@ -1069,7 +1069,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
         ctx4.abstract_syntax = samba.dcerpc.mgmt.abstract_syntax()
         ctx4.transfer_syntaxes = tsf4_list
 
         ctx4.abstract_syntax = samba.dcerpc.mgmt.abstract_syntax()
         ctx4.transfer_syntaxes = tsf4_list
 
-        req = self.generate_alter(call_id=34, ctx_list=[ctx3,ctx4])
+        req = self.generate_alter(call_id=34, ctx_list=[ctx3, ctx4])
         self.send_pdu(req)
         rep = self.recv_pdu()
         self.verify_pdu(rep, dcerpc.DCERPC_PKT_ALTER_RESP, req.call_id,
         self.send_pdu(req)
         rep = self.recv_pdu()
         self.verify_pdu(rep, dcerpc.DCERPC_PKT_ALTER_RESP, req.call_id,
@@ -1106,7 +1106,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
         self.assertEquals(rep.u.cancel_count, 0)
         self.assertGreaterEqual(len(rep.u.stub_and_verifier), rep.u.alloc_hint)
 
         self.assertEquals(rep.u.cancel_count, 0)
         self.assertGreaterEqual(len(rep.u.stub_and_verifier), rep.u.alloc_hint)
 
-        req = self.generate_alter(call_id=43, ctx_list=[ctx4,ctx3])
+        req = self.generate_alter(call_id=43, ctx_list=[ctx4, ctx3])
         self.send_pdu(req)
         rep = self.recv_pdu()
         self.verify_pdu(rep, dcerpc.DCERPC_PKT_ALTER_RESP, req.call_id,
         self.send_pdu(req)
         rep = self.recv_pdu()
         self.verify_pdu(rep, dcerpc.DCERPC_PKT_ALTER_RESP, req.call_id,
@@ -1156,7 +1156,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
         self.assertEquals(rep.u.cancel_count, 0)
         self.assertGreaterEqual(len(rep.u.stub_and_verifier), rep.u.alloc_hint)
 
         self.assertEquals(rep.u.cancel_count, 0)
         self.assertGreaterEqual(len(rep.u.stub_and_verifier), rep.u.alloc_hint)
 
-        req = self.generate_alter(call_id=44, ctx_list=[ctx4,ctx4])
+        req = self.generate_alter(call_id=44, ctx_list=[ctx4, ctx4])
         self.send_pdu(req)
         rep = self.recv_pdu()
         self.verify_pdu(rep, dcerpc.DCERPC_PKT_ALTER_RESP, req.call_id,
         self.send_pdu(req)
         rep = self.recv_pdu()
         self.verify_pdu(rep, dcerpc.DCERPC_PKT_ALTER_RESP, req.call_id,
@@ -1220,7 +1220,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
         ctx5epm.abstract_syntax = samba.dcerpc.mgmt.abstract_syntax()
         ctx5epm.transfer_syntaxes = tsf5epm_list
 
         ctx5epm.abstract_syntax = samba.dcerpc.mgmt.abstract_syntax()
         ctx5epm.transfer_syntaxes = tsf5epm_list
 
-        req = self.generate_alter(call_id=55, ctx_list=[ctx5mgmt,ctx5epm])
+        req = self.generate_alter(call_id=55, ctx_list=[ctx5mgmt, ctx5epm])
         self.send_pdu(req)
         rep = self.recv_pdu()
         self.verify_pdu(rep, dcerpc.DCERPC_PKT_ALTER_RESP, req.call_id,
         self.send_pdu(req)
         rep = self.recv_pdu()
         self.verify_pdu(rep, dcerpc.DCERPC_PKT_ALTER_RESP, req.call_id,
@@ -1257,7 +1257,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
         self.assertEquals(rep.u.cancel_count, 0)
         self.assertGreaterEqual(len(rep.u.stub_and_verifier), rep.u.alloc_hint)
 
         self.assertEquals(rep.u.cancel_count, 0)
         self.assertGreaterEqual(len(rep.u.stub_and_verifier), rep.u.alloc_hint)
 
-        req = self.generate_alter(call_id=55, ctx_list=[ctx5mgmt,ctx5epm])
+        req = self.generate_alter(call_id=55, ctx_list=[ctx5mgmt, ctx5epm])
         self.send_pdu(req)
         rep = self.recv_pdu()
         self.verify_pdu(rep, dcerpc.DCERPC_PKT_ALTER_RESP, req.call_id,
         self.send_pdu(req)
         rep = self.recv_pdu()
         self.verify_pdu(rep, dcerpc.DCERPC_PKT_ALTER_RESP, req.call_id,
@@ -1337,7 +1337,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
         zero_syntax = misc.ndr_syntax_id()
         ndr64 = base.transfer_syntax_ndr64()
 
         zero_syntax = misc.ndr_syntax_id()
         ndr64 = base.transfer_syntax_ndr64()
 
-        tsf1_list = [btf1,btf2,zero_syntax]
+        tsf1_list = [btf1, btf2, zero_syntax]
         ctx1 = dcerpc.ctx_list()
         ctx1.context_id = 1
         ctx1.num_transfer_syntaxes = len(tsf1_list)
         ctx1 = dcerpc.ctx_list()
         ctx1.context_id = 1
         ctx1.num_transfer_syntaxes = len(tsf1_list)
@@ -1372,7 +1372,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
 
         zero_syntax = misc.ndr_syntax_id()
 
 
         zero_syntax = misc.ndr_syntax_id()
 
-        tsf1_list = [zero_syntax,btf1,btf2,zero_syntax]
+        tsf1_list = [zero_syntax, btf1, btf2, zero_syntax]
         ctx1 = dcerpc.ctx_list()
         ctx1.context_id = 1
         ctx1.num_transfer_syntaxes = len(tsf1_list)
         ctx1 = dcerpc.ctx_list()
         ctx1.context_id = 1
         ctx1.num_transfer_syntaxes = len(tsf1_list)
@@ -1422,7 +1422,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
         ctx2.abstract_syntax = zero_syntax
         ctx2.transfer_syntaxes = tsf2_list
 
         ctx2.abstract_syntax = zero_syntax
         ctx2.transfer_syntaxes = tsf2_list
 
-        req = self.generate_bind(call_id=0, ctx_list=[ctx1,ctx2])
+        req = self.generate_bind(call_id=0, ctx_list=[ctx1, ctx2])
         self.send_pdu(req)
         rep = self.recv_pdu()
         self.verify_pdu(rep, dcerpc.DCERPC_PKT_BIND_NAK, req.call_id,
         self.send_pdu(req)
         rep = self.recv_pdu()
         self.verify_pdu(rep, dcerpc.DCERPC_PKT_BIND_NAK, req.call_id,
@@ -1482,7 +1482,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
         zero_syntax = misc.ndr_syntax_id()
         ndr64 = base.transfer_syntax_ndr64()
 
         zero_syntax = misc.ndr_syntax_id()
         ndr64 = base.transfer_syntax_ndr64()
 
-        tsf1_list = [btf1,btf2,zero_syntax]
+        tsf1_list = [btf1, btf2, zero_syntax]
         ctx1 = dcerpc.ctx_list()
         ctx1.context_id = 1
         ctx1.num_transfer_syntaxes = len(tsf1_list)
         ctx1 = dcerpc.ctx_list()
         ctx1.context_id = 1
         ctx1.num_transfer_syntaxes = len(tsf1_list)
@@ -1760,8 +1760,8 @@ class TestDCERPC_BIND(RawDCERPCTest):
                                     opnum=0,
                                     alloc_hint=0xffffffff,
                                     stub="\00" * chunk_size)
                                     opnum=0,
                                     alloc_hint=0xffffffff,
                                     stub="\00" * chunk_size)
-        self.send_pdu(req,ndr_print=True,hexdump=True)
-        rep = self.recv_pdu(ndr_print=True,hexdump=True)
+        self.send_pdu(req, ndr_print=True, hexdump=True)
+        rep = self.recv_pdu(ndr_print=True, hexdump=True)
         self.verify_pdu(rep, dcerpc.DCERPC_PKT_RESPONSE, req.call_id,
                         auth_length=0)
         self.assertNotEquals(rep.u.alloc_hint, 0)
         self.verify_pdu(rep, dcerpc.DCERPC_PKT_RESPONSE, req.call_id,
                         auth_length=0)
         self.assertNotEquals(rep.u.alloc_hint, 0)
@@ -1985,7 +1985,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
                 alloc_hint -= thistime
             else:
                 alloc_hint = 0
                 alloc_hint -= thistime
             else:
                 alloc_hint = 0
-            self.send_pdu(req,hexdump=False)
+            self.send_pdu(req, hexdump=False)
             if fault_first is not None:
                 rep = self.recv_pdu()
                 # We get a fault back
             if fault_first is not None:
                 rep = self.recv_pdu()
                 # We get a fault back
@@ -3545,7 +3545,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
         ctx1.abstract_syntax = samba.dcerpc.mgmt.abstract_syntax()
         ctx1.transfer_syntaxes = tsf1_list
 
         ctx1.abstract_syntax = samba.dcerpc.mgmt.abstract_syntax()
         ctx1.transfer_syntaxes = tsf1_list
 
-        tsf1b_list = [ndr32,ndr64]
+        tsf1b_list = [ndr32, ndr64]
         ctx1b = dcerpc.ctx_list()
         ctx1b.context_id = 1
         ctx1b.num_transfer_syntaxes = len(tsf1b_list)
         ctx1b = dcerpc.ctx_list()
         ctx1b.context_id = 1
         ctx1b.num_transfer_syntaxes = len(tsf1b_list)
@@ -3714,7 +3714,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
         ctx1.abstract_syntax = samba.dcerpc.mgmt.abstract_syntax()
         ctx1.transfer_syntaxes = tsf1_list
 
         ctx1.abstract_syntax = samba.dcerpc.mgmt.abstract_syntax()
         ctx1.transfer_syntaxes = tsf1_list
 
-        tsf1b_list = [ndr32,ndr64]
+        tsf1b_list = [ndr32, ndr64]
         ctx1b = dcerpc.ctx_list()
         ctx1b.context_id = 1
         ctx1b.num_transfer_syntaxes = len(tsf1b_list)
         ctx1b = dcerpc.ctx_list()
         ctx1b.context_id = 1
         ctx1b.num_transfer_syntaxes = len(tsf1b_list)
@@ -3802,7 +3802,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
         ctx1.abstract_syntax = samba.dcerpc.mgmt.abstract_syntax()
         ctx1.transfer_syntaxes = tsf1_list
 
         ctx1.abstract_syntax = samba.dcerpc.mgmt.abstract_syntax()
         ctx1.transfer_syntaxes = tsf1_list
 
-        tsf1b_list = [ndr32,ndr64]
+        tsf1b_list = [ndr32, ndr64]
         ctx1b = dcerpc.ctx_list()
         ctx1b.context_id = 1
         ctx1b.num_transfer_syntaxes = len(tsf1b_list)
         ctx1b = dcerpc.ctx_list()
         ctx1b.context_id = 1
         ctx1b.num_transfer_syntaxes = len(tsf1b_list)
@@ -4935,7 +4935,7 @@ class TestDCERPC_BIND(RawDCERPCTest):
         time.sleep(0.5)
         self.connect()
 
         time.sleep(0.5)
         self.connect()
 
-        ack2 = self.do_generic_bind(ctx=ctx,assoc_group_id=ack.u.assoc_group_id,
+        ack2 = self.do_generic_bind(ctx=ctx, assoc_group_id=ack.u.assoc_group_id,
                                     nak_reason=dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
         return
 
                                     nak_reason=dcerpc.DCERPC_BIND_NAK_REASON_NOT_SPECIFIED)
         return
 
index c7809ee2bc072e30a113bd52042e2da018457362..b6bba02bbb7f54de5171f412948dd1ef8186bb38 100644 (file)
@@ -478,7 +478,7 @@ class RawDCERPCTest(TestCase):
         floor5.lhs = lhs5
         floor5.rhs.ipaddr = "0.0.0.0"
 
         floor5.lhs = lhs5
         floor5.rhs.ipaddr = "0.0.0.0"
 
-        floors = [floor1,floor2,floor3,floor4,floor5]
+        floors = [floor1, floor2, floor3, floor4, floor5]
         req_tower = samba.dcerpc.epmapper.epm_tower()
         req_tower.num_floors = len(floors)
         req_tower.floors = floors
         req_tower = samba.dcerpc.epmapper.epm_tower()
         req_tower.num_floors = len(floors)
         req_tower.floors = floors
@@ -572,7 +572,7 @@ class RawDCERPCTest(TestCase):
         try:
             rep_pdu = self.recv_raw(hexdump=hexdump, timeout=timeout)
             if rep_pdu is None:
         try:
             rep_pdu = self.recv_raw(hexdump=hexdump, timeout=timeout)
             if rep_pdu is None:
-                return (None,None)
+                return (None, None)
             rep = ndr_unpack(samba.dcerpc.dcerpc.ncacn_packet, rep_pdu, allow_remaining=True)
             if ndr_print:
                 sys.stderr.write("recv_pdu: %s" % samba.ndr.ndr_print(rep))
             rep = ndr_unpack(samba.dcerpc.dcerpc.ncacn_packet, rep_pdu, allow_remaining=True)
             if ndr_print:
                 sys.stderr.write("recv_pdu: %s" % samba.ndr.ndr_print(rep))
index 33cb867f09c262aa8162ebb90100663a183aaf8d..0711ae4154670f5072a321904553f9a7a79641a0 100644 (file)
@@ -40,7 +40,7 @@ class RpcEchoTests(RpcInterfaceTestCase):
         self.assertEquals(2, self.conn.AddOne(1))
 
     def test_echodata(self):
         self.assertEquals(2, self.conn.AddOne(1))
 
     def test_echodata(self):
-        self.assertEquals([1,2,3], self.conn.EchoData([1, 2, 3]))
+        self.assertEquals([1, 2, 3], self.conn.EchoData([1, 2, 3]))
 
     def test_call(self):
         self.assertEquals(u"foobar", self.conn.TestCall(u"foobar"))
 
     def test_call(self):
         self.assertEquals(u"foobar", self.conn.TestCall(u"foobar"))
@@ -48,7 +48,7 @@ class RpcEchoTests(RpcInterfaceTestCase):
     def test_surrounding(self):
         surrounding_struct = echo.Surrounding()
         surrounding_struct.x = 4
     def test_surrounding(self):
         surrounding_struct = echo.Surrounding()
         surrounding_struct.x = 4
-        surrounding_struct.surrounding = [1,2,3,4]
+        surrounding_struct.surrounding = [1, 2, 3, 4]
         y = self.conn.TestSurrounding(surrounding_struct)
         self.assertEquals(8 * [0], y.surrounding)
 
         y = self.conn.TestSurrounding(surrounding_struct)
         self.assertEquals(8 * [0], y.surrounding)
 
index e02ed8b7a4bcb8cedf58254ab092cda63926927e..7dacfb2cbc325c700d190f02ebb602e56e1d460a 100644 (file)
@@ -103,7 +103,7 @@ class SmbDotConfTests(TestCase):
                          'panic action', 'homedir map', 'NIS homedir',
                          'server string', 'netbios name', 'socket options', 'use mmap',
                          'ctdbd socket', 'printing', 'printcap name', 'queueresume command',
                          'panic action', 'homedir map', 'NIS homedir',
                          'server string', 'netbios name', 'socket options', 'use mmap',
                          'ctdbd socket', 'printing', 'printcap name', 'queueresume command',
-                         'queuepause command','lpresume command', 'lppause command',
+                         'queuepause command', 'lpresume command', 'lppause command',
                          'lprm command', 'lpq command', 'print command', 'template homedir',
                          'max open files',
                          'include system krb5 conf', 'rpc server dynamic port range',
                          'lprm command', 'lpq command', 'print command', 'template homedir',
                          'max open files',
                          'include system krb5 conf', 'rpc server dynamic port range',
@@ -258,14 +258,14 @@ class SmbDotConfTests(TestCase):
                      'bytes': '10',
                      'octal': '0123',
                      'ustring': 'ustring',
                      'bytes': '10',
                      'octal': '0123',
                      'ustring': 'ustring',
-                     'enum':'', 'boolean-auto': '', 'char': 'a', 'list': 'a, b, c'}
+                     'enum': '', 'boolean-auto': '', 'char': 'a', 'list': 'a, b, c'}
         opposite_arbitrary = {'string': 'string2', 'boolean': 'no', 'integer': '6',
                               'boolean-rev': 'no',
                               'cmdlist': 'd e f',
                               'bytes': '11',
                               'octal': '0567',
                               'ustring': 'ustring2',
         opposite_arbitrary = {'string': 'string2', 'boolean': 'no', 'integer': '6',
                               'boolean-rev': 'no',
                               'cmdlist': 'd e f',
                               'bytes': '11',
                               'octal': '0567',
                               'ustring': 'ustring2',
-                              'enum':'', 'boolean-auto': '', 'char': 'b', 'list': 'd, e, f'}
+                              'enum': '', 'boolean-auto': '', 'char': 'b', 'list': 'd, e, f'}
 
         failset = set()
         count = 0
 
         failset = set()
         count = 0
index cd3851e2f408b99c94b685c4d463d58ac5cdb75b..332526ed795532c85d5a82c25cbfb9d8d31899f7 100644 (file)
@@ -235,7 +235,7 @@ class DsdbLockTestCase(SamDBTestCase):
 
             backenddb.transaction_start()
 
 
             backenddb.transaction_start()
 
-            backenddb.add({"dn":"@DSDB_LOCK_TEST"})
+            backenddb.add({"dn": "@DSDB_LOCK_TEST"})
             backenddb.delete("@DSDB_LOCK_TEST")
 
             # Obtain a write lock
             backenddb.delete("@DSDB_LOCK_TEST")
 
             # Obtain a write lock
@@ -335,7 +335,7 @@ class DsdbLockTestCase(SamDBTestCase):
         os.write(w1, b"started")
 
         self.assertEqual(os.read(r2, 3), b"add")
         os.write(w1, b"started")
 
         self.assertEqual(os.read(r2, 3), b"add")
-        backenddb.add({"dn":"@DSDB_LOCK_TEST"})
+        backenddb.add({"dn": "@DSDB_LOCK_TEST"})
         backenddb.delete("@DSDB_LOCK_TEST")
         os.write(w1, b"added")
 
         backenddb.delete("@DSDB_LOCK_TEST")
         os.write(w1, b"added")
 
index dbfafc4122dce267498ebe45290c2e83ff1562a6..d5ad336b13c5be115fe629578880f9611210880f 100644 (file)
@@ -74,7 +74,7 @@ objectClass: attributeSchema
 adminDescription: """ + attr_name + """
 adminDisplayName: """ + attr_name + """
 cn: """ + attr_name + """
 adminDescription: """ + attr_name + """
 adminDisplayName: """ + attr_name + """
 cn: """ + attr_name + """
-attributeId: 1.3.6.1.4.1.7165.4.6.1.8.%d.""" % sub_oid + str(random.randint(1,100000)) + """
+attributeId: 1.3.6.1.4.1.7165.4.6.1.8.%d.""" % sub_oid + str(random.randint(1, 100000)) + """
 attributeSyntax: 2.5.5.12
 omSyntax: 64
 instanceType: 4
 attributeSyntax: 2.5.5.12
 omSyntax: 64
 instanceType: 4
index 526dc0fe4e311e789fd65b0db9964a22c6e26f92..94f511ccf3f1c62b182597a2cd62f145c271f919 100644 (file)
@@ -56,10 +56,10 @@ class ShareTests(TestCase):
 
     def test_iter(self):
         self.assertEquals([], list(self._get_shares({})))
 
     def test_iter(self):
         self.assertEquals([], list(self._get_shares({})))
-        self.assertEquals([], list(self._get_shares({"global":{}})))
+        self.assertEquals([], list(self._get_shares({"global": {}})))
         self.assertEquals(
             ["bla"],
         self.assertEquals(
             ["bla"],
-            list(self._get_shares({"global":{}, "bla":{}})))
+            list(self._get_shares({"global": {}, "bla": {}})))
 
     def test_len(self):
         shares = self._get_shares({"global": {}})
 
     def test_len(self):
         shares = self._get_shares({"global": {}})
index e1a7ec944520bc4c86cca6c186df7b4fa855b945..bcf17f8f2274f2fd9c4f0420bcfc1c06efff6b22 100644 (file)
@@ -197,5 +197,5 @@ class PassWordHashFl2003Tests(PassWordHashTests):
         #
         up = ndr_unpack(drsblobs.package_PrimaryUserPasswordBlob,
                         binascii.a2b_hex(up_package.data))
         #
         up = ndr_unpack(drsblobs.package_PrimaryUserPasswordBlob,
                         binascii.a2b_hex(up_package.data))
-        self.checkUserPassword(up, [("{CRYPT}", "6",10000)])
+        self.checkUserPassword(up, [("{CRYPT}", "6", 10000)])
         self.checkNtHash(USER_PASS, up.current_nt_hash.hash)
         self.checkNtHash(USER_PASS, up.current_nt_hash.hash)
index 70455a6e9d8c42610f7892bf15d10b524d99e2e2..91064b4f11b674c5fc8a02acd75de5e93fb65a7e 100644 (file)
@@ -112,7 +112,7 @@ class PassWordHashFl2008Tests(PassWordHashTests):
         #
         up = ndr_unpack(drsblobs.package_PrimaryUserPasswordBlob,
                         binascii.a2b_hex(up_package.data))
         #
         up = ndr_unpack(drsblobs.package_PrimaryUserPasswordBlob,
                         binascii.a2b_hex(up_package.data))
-        self.checkUserPassword(up, [("{CRYPT}", "6",None)])
+        self.checkUserPassword(up, [("{CRYPT}", "6", None)])
         self.checkNtHash(USER_PASS, up.current_nt_hash.hash)
 
     def test_supplementalCredentials_cleartext(self):
         self.checkNtHash(USER_PASS, up.current_nt_hash.hash)
 
     def test_supplementalCredentials_cleartext(self):
@@ -206,5 +206,5 @@ class PassWordHashFl2008Tests(PassWordHashTests):
         #
         up = ndr_unpack(drsblobs.package_PrimaryUserPasswordBlob,
                         binascii.a2b_hex(up_package.data))
         #
         up = ndr_unpack(drsblobs.package_PrimaryUserPasswordBlob,
                         binascii.a2b_hex(up_package.data))
-        self.checkUserPassword(up, [("{CRYPT}", "5",100)])
+        self.checkUserPassword(up, [("{CRYPT}", "5", 100)])
         self.checkNtHash(USER_PASS, up.current_nt_hash.hash)
         self.checkNtHash(USER_PASS, up.current_nt_hash.hash)
index 97ce6bb4a6fb3937dce4b94394dbe0fc0956675f..5926c11b1586664ed5cdac7cadbab37acd4a029f 100644 (file)
@@ -80,7 +80,7 @@ class PosixAclMappingTests(TestCaseInTempDir):
                  session_info=self.get_session_info())
         facl = getntacl(self.lp, self.tempf, direct_db_access=True)
         anysid = security.dom_sid(security.SID_NT_SELF)
                  session_info=self.get_session_info())
         facl = getntacl(self.lp, self.tempf, direct_db_access=True)
         anysid = security.dom_sid(security.SID_NT_SELF)
-        self.assertEquals(facl.as_sddl(anysid),acl)
+        self.assertEquals(facl.as_sddl(anysid), acl)
 
     def test_setntacl_smbd_setposixacl_getntacl(self):
         acl = ACL
 
     def test_setntacl_smbd_setposixacl_getntacl(self):
         acl = ACL
@@ -147,7 +147,7 @@ class PosixAclMappingTests(TestCaseInTempDir):
                  session_info=self.get_session_info())
         facl = getntacl(self.lp, self.tempf, direct_db_access=False)
         anysid = security.dom_sid(security.SID_NT_SELF)
                  session_info=self.get_session_info())
         facl = getntacl(self.lp, self.tempf, direct_db_access=False)
         anysid = security.dom_sid(security.SID_NT_SELF)
-        self.assertEquals(facl.as_sddl(anysid),acl)
+        self.assertEquals(facl.as_sddl(anysid), acl)
 
     def test_setntacl_smbd_getntacl_smbd(self):
         acl = ACL
 
     def test_setntacl_smbd_getntacl_smbd(self):
         acl = ACL
@@ -155,7 +155,7 @@ class PosixAclMappingTests(TestCaseInTempDir):
                  session_info=self.get_session_info())
         facl = getntacl(self.lp, self.tempf, direct_db_access=False)
         anysid = security.dom_sid(security.SID_NT_SELF)
                  session_info=self.get_session_info())
         facl = getntacl(self.lp, self.tempf, direct_db_access=False)
         anysid = security.dom_sid(security.SID_NT_SELF)
-        self.assertEquals(facl.as_sddl(anysid),acl)
+        self.assertEquals(facl.as_sddl(anysid), acl)
 
     def test_setntacl_smbd_setposixacl_getntacl_smbd(self):
         acl = ACL
 
     def test_setntacl_smbd_setposixacl_getntacl_smbd(self):
         acl = ACL
@@ -176,11 +176,11 @@ class PosixAclMappingTests(TestCaseInTempDir):
                  session_info=self.get_session_info())
         # This invalidates the hash of the NT acl just set because there is a hook in the posix ACL set code
         s4_passdb = passdb.PDB(self.lp.get("passdb backend"))
                  session_info=self.get_session_info())
         # This invalidates the hash of the NT acl just set because there is a hook in the posix ACL set code
         s4_passdb = passdb.PDB(self.lp.get("passdb backend"))
-        (BA_gid,BA_type) = s4_passdb.sid_to_id(BA_sid)
+        (BA_gid, BA_type) = s4_passdb.sid_to_id(BA_sid)
         smbd.set_simple_acl(self.tempf, 0o640, BA_gid)
 
         # This should re-calculate an ACL based on the posix details
         smbd.set_simple_acl(self.tempf, 0o640, BA_gid)
 
         # This should re-calculate an ACL based on the posix details
-        facl = getntacl(self.lp,self.tempf, direct_db_access=False)
+        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))
 
         anysid = security.dom_sid(security.SID_NT_SELF)
         self.assertEquals(simple_acl_from_posix, facl.as_sddl(anysid))
 
@@ -190,7 +190,7 @@ class PosixAclMappingTests(TestCaseInTempDir):
                  session_info=self.get_session_info())
         facl = getntacl(self.lp, self.tempf, direct_db_access=False)
         domsid = security.dom_sid(DOM_SID)
                  session_info=self.get_session_info())
         facl = getntacl(self.lp, self.tempf, direct_db_access=False)
         domsid = security.dom_sid(DOM_SID)
-        self.assertEquals(facl.as_sddl(domsid),acl)
+        self.assertEquals(facl.as_sddl(domsid), acl)
 
     def test_setntacl_getposixacl(self):
         acl = ACL
 
     def test_setntacl_getposixacl(self):
         acl = ACL
@@ -198,7 +198,7 @@ class PosixAclMappingTests(TestCaseInTempDir):
                  session_info=self.get_session_info())
         facl = getntacl(self.lp, self.tempf)
         anysid = security.dom_sid(security.SID_NT_SELF)
                  session_info=self.get_session_info())
         facl = getntacl(self.lp, self.tempf)
         anysid = security.dom_sid(security.SID_NT_SELF)
-        self.assertEquals(facl.as_sddl(anysid),acl)
+        self.assertEquals(facl.as_sddl(anysid), acl)
         posix_acl = smbd.get_sys_acl(self.tempf, smb_acl.SMB_ACL_TYPE_ACCESS)
 
     def test_setposixacl_getntacl(self):
         posix_acl = smbd.get_sys_acl(self.tempf, smb_acl.SMB_ACL_TYPE_ACCESS)
 
     def test_setposixacl_getntacl(self):
@@ -221,10 +221,10 @@ class PosixAclMappingTests(TestCaseInTempDir):
         user_SID = s4_passdb.uid_to_sid(os.stat(self.tempdir).st_uid)
         BA_sid = security.dom_sid(security.SID_BUILTIN_ADMINISTRATORS)
         s4_passdb = passdb.PDB(self.lp.get("passdb backend"))
         user_SID = s4_passdb.uid_to_sid(os.stat(self.tempdir).st_uid)
         BA_sid = security.dom_sid(security.SID_BUILTIN_ADMINISTRATORS)
         s4_passdb = passdb.PDB(self.lp.get("passdb backend"))
-        (BA_id,BA_type) = s4_passdb.sid_to_id(BA_sid)
+        (BA_id, BA_type) = s4_passdb.sid_to_id(BA_sid)
         self.assertEquals(BA_type, idmap.ID_TYPE_BOTH)
         SO_sid = security.dom_sid(security.SID_BUILTIN_SERVER_OPERATORS)
         self.assertEquals(BA_type, idmap.ID_TYPE_BOTH)
         SO_sid = security.dom_sid(security.SID_BUILTIN_SERVER_OPERATORS)
-        (SO_id,SO_type) = s4_passdb.sid_to_id(SO_sid)
+        (SO_id, SO_type) = s4_passdb.sid_to_id(SO_sid)
         self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)
         smbd.chown(self.tempdir, BA_id, SO_id)
         smbd.set_simple_acl(self.tempdir, 0o750)
         self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)
         smbd.chown(self.tempdir, BA_id, SO_id)
         smbd.set_simple_acl(self.tempdir, 0o750)
@@ -237,7 +237,7 @@ class PosixAclMappingTests(TestCaseInTempDir):
     def test_setposixacl_group_getntacl_smbd(self):
         BA_sid = security.dom_sid(security.SID_BUILTIN_ADMINISTRATORS)
         s4_passdb = passdb.PDB(self.lp.get("passdb backend"))
     def test_setposixacl_group_getntacl_smbd(self):
         BA_sid = security.dom_sid(security.SID_BUILTIN_ADMINISTRATORS)
         s4_passdb = passdb.PDB(self.lp.get("passdb backend"))
-        (BA_gid,BA_type) = s4_passdb.sid_to_id(BA_sid)
+        (BA_gid, BA_type) = s4_passdb.sid_to_id(BA_sid)
         group_SID = s4_passdb.gid_to_sid(os.stat(self.tempf).st_gid)
         user_SID = s4_passdb.uid_to_sid(os.stat(self.tempf).st_uid)
         self.assertEquals(BA_type, idmap.ID_TYPE_BOTH)
         group_SID = s4_passdb.gid_to_sid(os.stat(self.tempf).st_gid)
         user_SID = s4_passdb.uid_to_sid(os.stat(self.tempf).st_uid)
         self.assertEquals(BA_type, idmap.ID_TYPE_BOTH)
@@ -285,7 +285,7 @@ class PosixAclMappingTests(TestCaseInTempDir):
     def test_setposixacl_group_getposixacl(self):
         BA_sid = security.dom_sid(security.SID_BUILTIN_ADMINISTRATORS)
         s4_passdb = passdb.PDB(self.lp.get("passdb backend"))
     def test_setposixacl_group_getposixacl(self):
         BA_sid = security.dom_sid(security.SID_BUILTIN_ADMINISTRATORS)
         s4_passdb = passdb.PDB(self.lp.get("passdb backend"))
-        (BA_gid,BA_type) = s4_passdb.sid_to_id(BA_sid)
+        (BA_gid, BA_type) = s4_passdb.sid_to_id(BA_sid)
         self.assertEquals(BA_type, idmap.ID_TYPE_BOTH)
         smbd.set_simple_acl(self.tempf, 0o670, BA_gid)
         posix_acl = smbd.get_sys_acl(self.tempf, smb_acl.SMB_ACL_TYPE_ACCESS)
         self.assertEquals(BA_type, idmap.ID_TYPE_BOTH)
         smbd.set_simple_acl(self.tempf, 0o670, BA_gid)
         posix_acl = smbd.get_sys_acl(self.tempf, smb_acl.SMB_ACL_TYPE_ACCESS)
@@ -315,7 +315,7 @@ class PosixAclMappingTests(TestCaseInTempDir):
         setntacl(self.lp, self.tempf, acl, str(domsid), use_ntvfs=False,
                  session_info=session_info)
         facl = getntacl(self.lp, self.tempf)
         setntacl(self.lp, self.tempf, acl, str(domsid), use_ntvfs=False,
                  session_info=session_info)
         facl = getntacl(self.lp, self.tempf)
-        self.assertEquals(facl.as_sddl(domsid),acl)
+        self.assertEquals(facl.as_sddl(domsid), acl)
         posix_acl = smbd.get_sys_acl(self.tempf, smb_acl.SMB_ACL_TYPE_ACCESS)
 
         nwrap_module_so_path = os.getenv('NSS_WRAPPER_MODULE_SO_PATH')
         posix_acl = smbd.get_sys_acl(self.tempf, smb_acl.SMB_ACL_TYPE_ACCESS)
 
         nwrap_module_so_path = os.getenv('NSS_WRAPPER_MODULE_SO_PATH')
@@ -335,15 +335,15 @@ class PosixAclMappingTests(TestCaseInTempDir):
         # These assertions correct for current ad_dc selftest
         # configuration.  When other environments have a broad range of
         # groups mapped via passdb, we can relax some of these checks
         # These assertions correct for current ad_dc selftest
         # configuration.  When other environments have a broad range of
         # groups mapped via passdb, we can relax some of these checks
-        (LA_uid,LA_type) = s4_passdb.sid_to_id(LA_sid)
+        (LA_uid, LA_type) = s4_passdb.sid_to_id(LA_sid)
         self.assertEquals(LA_type, idmap.ID_TYPE_UID)
         self.assertEquals(LA_type, idmap.ID_TYPE_UID)
-        (BA_gid,BA_type) = s4_passdb.sid_to_id(BA_sid)
+        (BA_gid, BA_type) = s4_passdb.sid_to_id(BA_sid)
         self.assertEquals(BA_type, idmap.ID_TYPE_BOTH)
         self.assertEquals(BA_type, idmap.ID_TYPE_BOTH)
-        (SO_gid,SO_type) = s4_passdb.sid_to_id(SO_sid)
+        (SO_gid, SO_type) = s4_passdb.sid_to_id(SO_sid)
         self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)
         self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)
-        (SY_gid,SY_type) = s4_passdb.sid_to_id(SY_sid)
+        (SY_gid, SY_type) = s4_passdb.sid_to_id(SY_sid)
         self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)
         self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)
-        (AU_gid,AU_type) = s4_passdb.sid_to_id(AU_sid)
+        (AU_gid, AU_type) = s4_passdb.sid_to_id(AU_sid)
         self.assertEquals(AU_type, idmap.ID_TYPE_BOTH)
 
         self.assertEquals(posix_acl.count, 13, self.print_posix_acl(posix_acl))
         self.assertEquals(AU_type, idmap.ID_TYPE_BOTH)
 
         self.assertEquals(posix_acl.count, 13, self.print_posix_acl(posix_acl))
@@ -463,7 +463,7 @@ class PosixAclMappingTests(TestCaseInTempDir):
         setntacl(self.lp, self.tempdir, acl, str(domsid), use_ntvfs=False,
                  session_info=session_info)
         facl = getntacl(self.lp, self.tempdir)
         setntacl(self.lp, self.tempdir, acl, str(domsid), use_ntvfs=False,
                  session_info=session_info)
         facl = getntacl(self.lp, self.tempdir)
-        self.assertEquals(facl.as_sddl(domsid),acl)
+        self.assertEquals(facl.as_sddl(domsid), acl)
         posix_acl = smbd.get_sys_acl(self.tempdir, smb_acl.SMB_ACL_TYPE_ACCESS)
 
         LA_sid = security.dom_sid(str(domsid) + "-" + str(security.DOMAIN_RID_ADMINISTRATOR))
         posix_acl = smbd.get_sys_acl(self.tempdir, smb_acl.SMB_ACL_TYPE_ACCESS)
 
         LA_sid = security.dom_sid(str(domsid) + "-" + str(security.DOMAIN_RID_ADMINISTRATOR))
@@ -477,15 +477,15 @@ class PosixAclMappingTests(TestCaseInTempDir):
         # These assertions correct for current ad_dc selftest
         # configuration.  When other environments have a broad range of
         # groups mapped via passdb, we can relax some of these checks
         # These assertions correct for current ad_dc selftest
         # configuration.  When other environments have a broad range of
         # groups mapped via passdb, we can relax some of these checks
-        (LA_uid,LA_type) = s4_passdb.sid_to_id(LA_sid)
+        (LA_uid, LA_type) = s4_passdb.sid_to_id(LA_sid)
         self.assertEquals(LA_type, idmap.ID_TYPE_UID)
         self.assertEquals(LA_type, idmap.ID_TYPE_UID)
-        (BA_gid,BA_type) = s4_passdb.sid_to_id(BA_sid)
+        (BA_gid, BA_type) = s4_passdb.sid_to_id(BA_sid)
         self.assertEquals(BA_type, idmap.ID_TYPE_BOTH)
         self.assertEquals(BA_type, idmap.ID_TYPE_BOTH)
-        (SO_gid,SO_type) = s4_passdb.sid_to_id(SO_sid)
+        (SO_gid, SO_type) = s4_passdb.sid_to_id(SO_sid)
         self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)
         self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)
-        (SY_gid,SY_type) = s4_passdb.sid_to_id(SY_sid)
+        (SY_gid, SY_type) = s4_passdb.sid_to_id(SY_sid)
         self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)
         self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)
-        (AU_gid,AU_type) = s4_passdb.sid_to_id(AU_sid)
+        (AU_gid, AU_type) = s4_passdb.sid_to_id(AU_sid)
         self.assertEquals(AU_type, idmap.ID_TYPE_BOTH)
 
         self.assertEquals(posix_acl.count, 13, self.print_posix_acl(posix_acl))
         self.assertEquals(AU_type, idmap.ID_TYPE_BOTH)
 
         self.assertEquals(posix_acl.count, 13, self.print_posix_acl(posix_acl))
@@ -558,7 +558,7 @@ class PosixAclMappingTests(TestCaseInTempDir):
         setntacl(self.lp, self.tempdir, acl, str(domsid), use_ntvfs=False,
                  session_info=session_info)
         facl = getntacl(self.lp, self.tempdir)
         setntacl(self.lp, self.tempdir, acl, str(domsid), use_ntvfs=False,
                  session_info=session_info)
         facl = getntacl(self.lp, self.tempdir)
-        self.assertEquals(facl.as_sddl(domsid),acl)
+        self.assertEquals(facl.as_sddl(domsid), acl)
         posix_acl = smbd.get_sys_acl(self.tempdir, smb_acl.SMB_ACL_TYPE_ACCESS)
 
         LA_sid = security.dom_sid(str(domsid) + "-" + str(security.DOMAIN_RID_ADMINISTRATOR))
         posix_acl = smbd.get_sys_acl(self.tempdir, smb_acl.SMB_ACL_TYPE_ACCESS)
 
         LA_sid = security.dom_sid(str(domsid) + "-" + str(security.DOMAIN_RID_ADMINISTRATOR))
@@ -573,17 +573,17 @@ class PosixAclMappingTests(TestCaseInTempDir):
         # These assertions correct for current ad_dc selftest
         # configuration.  When other environments have a broad range of
         # groups mapped via passdb, we can relax some of these checks
         # These assertions correct for current ad_dc selftest
         # configuration.  When other environments have a broad range of
         # groups mapped via passdb, we can relax some of these checks
-        (LA_uid,LA_type) = s4_passdb.sid_to_id(LA_sid)
+        (LA_uid, LA_type) = s4_passdb.sid_to_id(LA_sid)
         self.assertEquals(LA_type, idmap.ID_TYPE_UID)
         self.assertEquals(LA_type, idmap.ID_TYPE_UID)
-        (BA_gid,BA_type) = s4_passdb.sid_to_id(BA_sid)
+        (BA_gid, BA_type) = s4_passdb.sid_to_id(BA_sid)
         self.assertEquals(BA_type, idmap.ID_TYPE_BOTH)
         self.assertEquals(BA_type, idmap.ID_TYPE_BOTH)
-        (SO_gid,SO_type) = s4_passdb.sid_to_id(SO_sid)
+        (SO_gid, SO_type) = s4_passdb.sid_to_id(SO_sid)
         self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)
         self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)
-        (SY_gid,SY_type) = s4_passdb.sid_to_id(SY_sid)
+        (SY_gid, SY_type) = s4_passdb.sid_to_id(SY_sid)
         self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)
         self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)
-        (AU_gid,AU_type) = s4_passdb.sid_to_id(AU_sid)
+        (AU_gid, AU_type) = s4_passdb.sid_to_id(AU_sid)
         self.assertEquals(AU_type, idmap.ID_TYPE_BOTH)
         self.assertEquals(AU_type, idmap.ID_TYPE_BOTH)
-        (PA_gid,PA_type) = s4_passdb.sid_to_id(PA_sid)
+        (PA_gid, PA_type) = s4_passdb.sid_to_id(PA_sid)
         self.assertEquals(PA_type, idmap.ID_TYPE_BOTH)
 
         self.assertEquals(posix_acl.count, 15, self.print_posix_acl(posix_acl))
         self.assertEquals(PA_type, idmap.ID_TYPE_BOTH)
 
         self.assertEquals(posix_acl.count, 15, self.print_posix_acl(posix_acl))
@@ -667,7 +667,7 @@ class PosixAclMappingTests(TestCaseInTempDir):
         setntacl(self.lp, self.tempf, acl, str(domsid), use_ntvfs=False,
                  session_info=session_info)
         facl = getntacl(self.lp, self.tempf)
         setntacl(self.lp, self.tempf, acl, str(domsid), use_ntvfs=False,
                  session_info=session_info)
         facl = getntacl(self.lp, self.tempf)
-        self.assertEquals(facl.as_sddl(domsid),acl)
+        self.assertEquals(facl.as_sddl(domsid), acl)
         posix_acl = smbd.get_sys_acl(self.tempf, smb_acl.SMB_ACL_TYPE_ACCESS)
 
         nwrap_module_so_path = os.getenv('NSS_WRAPPER_MODULE_SO_PATH')
         posix_acl = smbd.get_sys_acl(self.tempf, smb_acl.SMB_ACL_TYPE_ACCESS)
 
         nwrap_module_so_path = os.getenv('NSS_WRAPPER_MODULE_SO_PATH')
@@ -688,17 +688,17 @@ class PosixAclMappingTests(TestCaseInTempDir):
         # These assertions correct for current ad_dc selftest
         # configuration.  When other environments have a broad range of
         # groups mapped via passdb, we can relax some of these checks
         # These assertions correct for current ad_dc selftest
         # configuration.  When other environments have a broad range of
         # groups mapped via passdb, we can relax some of these checks
-        (LA_uid,LA_type) = s4_passdb.sid_to_id(LA_sid)
+        (LA_uid, LA_type) = s4_passdb.sid_to_id(LA_sid)
         self.assertEquals(LA_type, idmap.ID_TYPE_UID)
         self.assertEquals(LA_type, idmap.ID_TYPE_UID)
-        (BA_gid,BA_type) = s4_passdb.sid_to_id(BA_sid)
+        (BA_gid, BA_type) = s4_passdb.sid_to_id(BA_sid)
         self.assertEquals(BA_type, idmap.ID_TYPE_BOTH)
         self.assertEquals(BA_type, idmap.ID_TYPE_BOTH)
-        (SO_gid,SO_type) = s4_passdb.sid_to_id(SO_sid)
+        (SO_gid, SO_type) = s4_passdb.sid_to_id(SO_sid)
         self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)
         self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)
-        (SY_gid,SY_type) = s4_passdb.sid_to_id(SY_sid)
+        (SY_gid, SY_type) = s4_passdb.sid_to_id(SY_sid)
         self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)
         self.assertEquals(SO_type, idmap.ID_TYPE_BOTH)
-        (AU_gid,AU_type) = s4_passdb.sid_to_id(AU_sid)
+        (AU_gid, AU_type) = s4_passdb.sid_to_id(AU_sid)
         self.assertEquals(AU_type, idmap.ID_TYPE_BOTH)
         self.assertEquals(AU_type, idmap.ID_TYPE_BOTH)
-        (PA_gid,PA_type) = s4_passdb.sid_to_id(PA_sid)
+        (PA_gid, PA_type) = s4_passdb.sid_to_id(PA_sid)
         self.assertEquals(PA_type, idmap.ID_TYPE_BOTH)
 
         self.assertEquals(posix_acl.count, 15, self.print_posix_acl(posix_acl))
         self.assertEquals(PA_type, idmap.ID_TYPE_BOTH)
 
         self.assertEquals(posix_acl.count, 15, self.print_posix_acl(posix_acl))
index a5e39eebe59f240733b551ff21d76bbd2e6527e5..1221435fcbc8bd4b828918ad03b2fdba59b53133 100644 (file)
@@ -203,7 +203,7 @@ class Samba3SamTestCase(MapBaseTestCase):
         #
         msg = self.ldb.search(expression="(cn=Foo)", base="cn=Foo",
                               scope=SCOPE_BASE,
         #
         msg = self.ldb.search(expression="(cn=Foo)", base="cn=Foo",
                               scope=SCOPE_BASE,
-                              attrs=['foo','blah','cn','showInAdvancedViewOnly'])
+                              attrs=['foo', 'blah', 'cn', 'showInAdvancedViewOnly'])
         self.assertEquals(len(msg), 1)
         self.assertEquals(str(msg[0]["showInAdvancedViewOnly"]), "TRUE")
         self.assertEquals(str(msg[0]["foo"]), "bar")
         self.assertEquals(len(msg), 1)
         self.assertEquals(str(msg[0]["showInAdvancedViewOnly"]), "TRUE")
         self.assertEquals(str(msg[0]["foo"]), "bar")
@@ -218,14 +218,14 @@ class Samba3SamTestCase(MapBaseTestCase):
 
         # Checking for existence of record (remote)
         msg = self.ldb.search(expression="(unixName=bin)",
 
         # Checking for existence of record (remote)
         msg = self.ldb.search(expression="(unixName=bin)",
-                              attrs=['unixName','cn','dn', 'sambaUnicodePwd'])
+                              attrs=['unixName', 'cn', 'dn', 'sambaUnicodePwd'])
         self.assertEquals(len(msg), 1)
         self.assertEquals(str(msg[0]["cn"]), "Niemand")
         self.assertEquals(str(msg[0]["sambaUnicodePwd"]), "geheim")
 
         # Checking for existence of record (local && remote)
         msg = self.ldb.search(expression="(&(unixName=bin)(sambaUnicodePwd=geheim))",
         self.assertEquals(len(msg), 1)
         self.assertEquals(str(msg[0]["cn"]), "Niemand")
         self.assertEquals(str(msg[0]["sambaUnicodePwd"]), "geheim")
 
         # Checking for existence of record (local && remote)
         msg = self.ldb.search(expression="(&(unixName=bin)(sambaUnicodePwd=geheim))",
-                              attrs=['unixName','cn','dn', 'sambaUnicodePwd'])
+                              attrs=['unixName', 'cn', 'dn', 'sambaUnicodePwd'])
         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")
         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")
@@ -233,7 +233,7 @@ class Samba3SamTestCase(MapBaseTestCase):
 
         # Checking for existence of record (local || remote)
         msg = self.ldb.search(expression="(|(unixName=bin)(sambaUnicodePwd=geheim))",
 
         # Checking for existence of record (local || remote)
         msg = self.ldb.search(expression="(|(unixName=bin)(sambaUnicodePwd=geheim))",
-                              attrs=['unixName','cn','dn', 'sambaUnicodePwd'])
+                              attrs=['unixName', 'cn', 'dn', 'sambaUnicodePwd'])
         #print "got %d replies" % len(msg)
         self.assertEquals(len(msg), 1)        # TODO: should check with more records
         self.assertEquals(str(msg[0]["cn"]), "Niemand")
         #print "got %d replies" % len(msg)
         self.assertEquals(len(msg), 1)        # TODO: should check with more records
         self.assertEquals(str(msg[0]["cn"]), "Niemand")
@@ -806,7 +806,7 @@ objectSid: S-1-5-21-4231626423-2410014848-2360679739-1052
         self.assertEquals(str(res[4]["lastLogon"]), "z")
 
         # Clean up
         self.assertEquals(str(res[4]["lastLogon"]), "z")
 
         # Clean up
-        dns = [self.samba4.dn("cn=%s" % n) for n in ["A","B","C","X","Y","Z"]]
+        dns = [self.samba4.dn("cn=%s" % n) for n in ["A", "B", "C", "X", "Y", "Z"]]
         for dn in dns:
             self.ldb.delete(dn)
 
         for dn in dns:
             self.ldb.delete(dn)
 
index 5c27c80f7834749deb831064cd48f237d76f452f..bc0e133c81c659240e55ffd3bc53159d3077f4bc 100644 (file)
@@ -88,12 +88,12 @@ class DnsCmdTestCase(SambaToolCmdTest):
                         "::1",
                         "::",
                         "1:1:1:1:1:1:1:1"],
                         "::1",
                         "::",
                         "1:1:1:1:1:1:1:1"],
-                "PTR":good_dns,
-                "CNAME":good_dns,
-                "NS":good_dns,
-                "MX":good_mx,
-                "SRV":good_srv,
-                "TXT":["text", "", "@#!", "\n"]
+                "PTR": good_dns,
+                "CNAME": good_dns,
+                "NS": good_dns,
+                "MX": good_mx,
+                "SRV": good_srv,
+                "TXT": ["text", "", "@#!", "\n"]
         }
 
         self.bad_records = {
         }
 
         self.bad_records = {
@@ -105,11 +105,11 @@ class DnsCmdTestCase(SambaToolCmdTest):
                         "1234:5678:9ABC:DEF0:1234:5678:9ABC:DEF0:1234",
                         "1234:5678:9ABC:DEF0:1234:5678:9ABC",
                         "1111::1111::1111"],
                         "1234:5678:9ABC:DEF0:1234:5678:9ABC:DEF0:1234",
                         "1234:5678:9ABC:DEF0:1234:5678:9ABC",
                         "1111::1111::1111"],
-                "PTR":bad_dns,
-                "CNAME":bad_dns,
-                "NS":bad_dns,
-                "MX":bad_mx,
-                "SRV":bad_srv
+                "PTR": bad_dns,
+                "CNAME": bad_dns,
+                "NS": bad_dns,
+                "MX": bad_mx,
+                "SRV": bad_srv
         }
 
     def tearDown(self):
         }
 
     def tearDown(self):
index 1f2194671e9932282cb4c9da66c1b0270a40a8ec..11c77e6105eb90c765e54ff174f594418b7ea11f 100644 (file)
@@ -49,7 +49,7 @@ class ForestCmdTestCase(SambaToolCmdTest):
                                                                os.environ["DC_PASSWORD"]))
 
         self.assertCmdSuccess(result, out, err)
                                                                os.environ["DC_PASSWORD"]))
 
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
         self.assertIn("dsheuristics: <NO VALUE>", out)
 
     def test_modify_dsheuristics(self):
         self.assertIn("dsheuristics: <NO VALUE>", out)
 
     def test_modify_dsheuristics(self):
@@ -62,5 +62,5 @@ class ForestCmdTestCase(SambaToolCmdTest):
                                                                os.environ["DC_PASSWORD"]))
 
         self.assertCmdSuccess(result, out, err)
                                                                os.environ["DC_PASSWORD"]))
 
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
         self.assertIn("set dsheuristics: 0000002", out)
         self.assertIn("set dsheuristics: 0000002", out)
index dcef4e5209b936ca4d384c0de8716217a3ca4a42..51b735ebcfb49843dddc1f416825be78a612a161 100644 (file)
@@ -26,7 +26,7 @@ class FsmoCmdTestCase(SambaToolCmdTest):
         (result, out, err) = self.runsubcmd("fsmo", "show")
 
         self.assertCmdSuccess(result, out, err)
         (result, out, err) = self.runsubcmd("fsmo", "show")
 
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
 
         # Check that the output is sensible
         samdb = self.getSamDB("-H", "ldap://%s" % os.environ["SERVER"],
 
         # Check that the output is sensible
         samdb = self.getSamDB("-H", "ldap://%s" % os.environ["SERVER"],
index bc966ff3e22a8eba03a9d30c071a5ed6efed5873..8b6fc889cf12e21c9e3ba187947d4acc4a53a5e2 100644 (file)
@@ -88,7 +88,7 @@ class GroupCmdTestCase(SambaToolCmdTest):
                                                                os.environ["DC_PASSWORD"]))
 
             self.assertCmdSuccess(result, out, err)
                                                                os.environ["DC_PASSWORD"]))
 
             self.assertCmdSuccess(result, out, err)
-            self.assertEquals(err,"","There shouldn't be any error message")
+            self.assertEquals(err, "", "There shouldn't be any error message")
             self.assertIn("Added group %s" % group["name"], out)
 
             found = self._find_group(group["name"])
             self.assertIn("Added group %s" % group["name"], out)
 
             found = self._find_group(group["name"])
@@ -177,7 +177,7 @@ class GroupCmdTestCase(SambaToolCmdTest):
                                             "-U%s%%%s" % (os.environ["DC_USERNAME"],
                                                           os.environ["DC_PASSWORD"]))
         self.assertCmdSuccess(result, out, err)
                                             "-U%s%%%s" % (os.environ["DC_USERNAME"],
                                                           os.environ["DC_PASSWORD"]))
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
         self.assertIn("dn: CN=Domain Users,CN=Users,DC=samba,DC=example,DC=com", out)
 
     def _randomGroup(self, base={}):
         self.assertIn("dn: CN=Domain Users,CN=Users,DC=samba,DC=example,DC=com", out)
 
     def _randomGroup(self, base={}):
index 1cc688f75ddd34e844e1594fb915087107682c0a..bfb534cd29740a1cce3e2f14f4cc3342e15d31f3 100644 (file)
@@ -26,4 +26,4 @@ class JoinCmdTestCase(SambaToolCmdTest):
         (result, out, err) = self.runsubcmd("domain", "join", os.environ["REALM"], "dc", "-U%s%%%s" % (os.environ["USERNAME"], os.environ["PASSWORD"]))
 
         self.assertCmdFail(result)
         (result, out, err) = self.runsubcmd("domain", "join", os.environ["REALM"], "dc", "-U%s%%%s" % (os.environ["USERNAME"], os.environ["PASSWORD"]))
 
         self.assertCmdFail(result)
-        self.assertTrue("Not removing account" in err,"Should fail with exception")
+        self.assertTrue("Not removing account" in err, "Should fail with exception")
index 3da750655480901e71051cc2352504f4f6b6b6eb..4078c271d98b0e6da671ab01da3d9e2335152184 100644 (file)
@@ -32,7 +32,7 @@ class NtACLCmdSysvolTestCase(SambaToolCmdTest):
         (result, out, err) = self.runsubcmd("ntacl", "sysvolreset",
                                              "--use-ntvfs")
         self.assertCmdSuccess(result, out, err)
         (result, out, err) = self.runsubcmd("ntacl", "sysvolreset",
                                              "--use-ntvfs")
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(out,"","Shouldn't be any output messages")
+        self.assertEquals(out, "", "Shouldn't be any output messages")
         self.assertIn("Please note that POSIX permissions have NOT been changed, only the stored NT ACL", err)
 
     def test_s3fs(self):
         self.assertIn("Please note that POSIX permissions have NOT been changed, only the stored NT ACL", err)
 
     def test_s3fs(self):
@@ -40,34 +40,34 @@ class NtACLCmdSysvolTestCase(SambaToolCmdTest):
                                              "--use-s3fs")
 
         self.assertCmdSuccess(result, out, err)
                                              "--use-s3fs")
 
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
-        self.assertEquals(out,"","Shouldn't be any output messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
+        self.assertEquals(out, "", "Shouldn't be any output messages")
 
     def test_ntvfs_check(self):
         (result, out, err) = self.runsubcmd("ntacl", "sysvolreset",
                                              "--use-ntvfs")
         self.assertCmdSuccess(result, out, err)
 
     def test_ntvfs_check(self):
         (result, out, err) = self.runsubcmd("ntacl", "sysvolreset",
                                              "--use-ntvfs")
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(out,"","Shouldn't be any output messages")
+        self.assertEquals(out, "", "Shouldn't be any output messages")
         self.assertIn("Please note that POSIX permissions have NOT been changed, only the stored NT ACL", err)
         # Now check they were set correctly
         (result, out, err) = self.runsubcmd("ntacl", "sysvolcheck")
         self.assertCmdSuccess(result, out, err)
         self.assertIn("Please note that POSIX permissions have NOT been changed, only the stored NT ACL", err)
         # Now check they were set correctly
         (result, out, err) = self.runsubcmd("ntacl", "sysvolcheck")
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
-        self.assertEquals(out,"","Shouldn't be any output messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
+        self.assertEquals(out, "", "Shouldn't be any output messages")
 
     def test_s3fs_check(self):
         (result, out, err) = self.runsubcmd("ntacl", "sysvolreset",
                                              "--use-s3fs")
 
         self.assertCmdSuccess(result, out, err)
 
     def test_s3fs_check(self):
         (result, out, err) = self.runsubcmd("ntacl", "sysvolreset",
                                              "--use-s3fs")
 
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
-        self.assertEquals(out,"","Shouldn't be any output messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
+        self.assertEquals(out, "", "Shouldn't be any output messages")
 
         # Now check they were set correctly
         (result, out, err) = self.runsubcmd("ntacl", "sysvolcheck")
         self.assertCmdSuccess(result, out, err)
 
         # Now check they were set correctly
         (result, out, err) = self.runsubcmd("ntacl", "sysvolcheck")
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
-        self.assertEquals(out,"","Shouldn't be any output messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
+        self.assertEquals(out, "", "Shouldn't be any output messages")
 
 class NtACLCmdGetSetTestCase(SambaToolCmdTest):
     """Tests for samba-tool ntacl get/set subcommands"""
 
 class NtACLCmdGetSetTestCase(SambaToolCmdTest):
     """Tests for samba-tool ntacl get/set subcommands"""
@@ -77,59 +77,59 @@ class NtACLCmdGetSetTestCase(SambaToolCmdTest):
 
     def test_ntvfs(self):
         path = os.environ['SELFTEST_PREFIX']
 
     def test_ntvfs(self):
         path = os.environ['SELFTEST_PREFIX']
-        tempf = os.path.join(path,"pytests" +str(int(100000 * random.random())))
+        tempf = os.path.join(path, "pytests" + str(int(100000 * random.random())))
         open(tempf, 'w').write("empty")
 
         (result, out, err) = self.runsubcmd("ntacl", "set", self.acl, tempf,
                                              "--use-ntvfs")
         self.assertCmdSuccess(result, out, err)
         open(tempf, 'w').write("empty")
 
         (result, out, err) = self.runsubcmd("ntacl", "set", self.acl, tempf,
                                              "--use-ntvfs")
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(out,"","Shouldn't be any output messages")
+        self.assertEquals(out, "", "Shouldn't be any output messages")
         self.assertIn("Please note that POSIX permissions have NOT been changed, only the stored NT ACL", err)
 
     def test_s3fs(self):
         path = os.environ['SELFTEST_PREFIX']
         self.assertIn("Please note that POSIX permissions have NOT been changed, only the stored NT ACL", err)
 
     def test_s3fs(self):
         path = os.environ['SELFTEST_PREFIX']
-        tempf = os.path.join(path,"pytests" +str(int(100000 * random.random())))
+        tempf = os.path.join(path, "pytests" + str(int(100000 * random.random())))
         open(tempf, 'w').write("empty")
 
         (result, out, err) = self.runsubcmd("ntacl", "set", self.acl, tempf,
                                              "--use-s3fs")
 
         self.assertCmdSuccess(result, out, err)
         open(tempf, 'w').write("empty")
 
         (result, out, err) = self.runsubcmd("ntacl", "set", self.acl, tempf,
                                              "--use-s3fs")
 
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
-        self.assertEquals(out,"","Shouldn't be any output messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
+        self.assertEquals(out, "", "Shouldn't be any output messages")
 
     def test_ntvfs_check(self):
         path = os.environ['SELFTEST_PREFIX']
 
     def test_ntvfs_check(self):
         path = os.environ['SELFTEST_PREFIX']
-        tempf = os.path.join(path,"pytests" +str(int(100000 * random.random())))
+        tempf = os.path.join(path, "pytests" + str(int(100000 * random.random())))
         open(tempf, 'w').write("empty")
 
         (result, out, err) = self.runsubcmd("ntacl", "set", self.acl, tempf,
                                              "--use-ntvfs")
         self.assertCmdSuccess(result, out, err)
         open(tempf, 'w').write("empty")
 
         (result, out, err) = self.runsubcmd("ntacl", "set", self.acl, tempf,
                                              "--use-ntvfs")
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(out,"","Shouldn't be any output messages")
+        self.assertEquals(out, "", "Shouldn't be any output messages")
         self.assertIn("Please note that POSIX permissions have NOT been changed, only the stored NT ACL", err)
 
         # Now check they were set correctly
         (result, out, err) = self.runsubcmd("ntacl",  "get", tempf,
                                              "--use-ntvfs", "--as-sddl")
         self.assertCmdSuccess(result, out, err)
         self.assertIn("Please note that POSIX permissions have NOT been changed, only the stored NT ACL", err)
 
         # Now check they were set correctly
         (result, out, err) = self.runsubcmd("ntacl",  "get", tempf,
                                              "--use-ntvfs", "--as-sddl")
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
         self.assertEquals(self.acl + "\n", out, "Output should be the ACL")
 
     def test_s3fs_check(self):
         path = os.environ['SELFTEST_PREFIX']
         self.assertEquals(self.acl + "\n", out, "Output should be the ACL")
 
     def test_s3fs_check(self):
         path = os.environ['SELFTEST_PREFIX']
-        tempf = os.path.join(path,"pytests" + str(int(100000 *random.random())))
+        tempf = os.path.join(path, "pytests" + str(int(100000 * random.random())))
         open(tempf, 'w').write("empty")
 
         (result, out, err) = self.runsubcmd("ntacl", "set", self.acl, tempf,
                                              "--use-s3fs")
         self.assertCmdSuccess(result, out, err)
         open(tempf, 'w').write("empty")
 
         (result, out, err) = self.runsubcmd("ntacl", "set", self.acl, tempf,
                                              "--use-s3fs")
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(out,"","Shouldn't be any output messages")
-        self.assertEquals(err,"","Shouldn't be any error messages")
+        self.assertEquals(out, "", "Shouldn't be any output messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
 
         # Now check they were set correctly
         (result, out, err) = self.runsubcmd("ntacl",  "get", tempf,
                                              "--use-s3fs", "--as-sddl")
         self.assertCmdSuccess(result, out, err)
 
         # Now check they were set correctly
         (result, out, err) = self.runsubcmd("ntacl",  "get", tempf,
                                              "--use-s3fs", "--as-sddl")
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
-        self.assertEquals(self.acl + "\n", out,"Output should be the ACL")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
+        self.assertEquals(self.acl + "\n", out, "Output should be the ACL")
index 3ae52449890f7eac090db5f3b71f7a24dd014f57..2259f06aa7d70963f8934cafd913a9ab564d166d 100644 (file)
@@ -35,7 +35,7 @@ class RodcCmdTestCase(SambaToolCmdTest):
         self.creds.guess(self.lp)
         self.session = system_session()
         self.ldb = SamDB("ldap://" + os.environ["DC_SERVER"],
         self.creds.guess(self.lp)
         self.session = system_session()
         self.ldb = SamDB("ldap://" + os.environ["DC_SERVER"],
-                         session_info=self.session, credentials=self.creds,lp=self.lp)
+                         session_info=self.session, credentials=self.creds, lp=self.lp)
 
         self.base_dn = self.ldb.domain_dn()
 
 
         self.base_dn = self.ldb.domain_dn()
 
index 56d09a78de753d616ebdc65b24d55c4f4f7b8569..ae095994e533e6849232c160adaee062b76847f6 100644 (file)
@@ -40,7 +40,7 @@ class SchemaCmdTestCase(SambaToolCmdTest):
                                                                os.environ["DC_PASSWORD"]))
 
         self.assertCmdSuccess(result, out, err)
                                                                os.environ["DC_PASSWORD"]))
 
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
         self.assertIn("dn: CN=uid,CN=Schema,CN=Configuration,DC=samba,DC=example,DC=com", out)
 
     def test_modify_attribute_searchflags(self):
         self.assertIn("dn: CN=uid,CN=Schema,CN=Configuration,DC=samba,DC=example,DC=com", out)
 
     def test_modify_attribute_searchflags(self):
@@ -60,7 +60,7 @@ class SchemaCmdTestCase(SambaToolCmdTest):
                                                                os.environ["DC_PASSWORD"]))
 
         self.assertCmdSuccess(result, out, err)
                                                                os.environ["DC_PASSWORD"]))
 
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
         self.assertIn("modified cn=uid,CN=Schema,CN=Configuration,DC=samba,DC=example,DC=com", out)
 
         (result, out, err) = self.runsublevelcmd("schema", ("attribute",
         self.assertIn("modified cn=uid,CN=Schema,CN=Configuration,DC=samba,DC=example,DC=com", out)
 
         (result, out, err) = self.runsublevelcmd("schema", ("attribute",
@@ -71,7 +71,7 @@ class SchemaCmdTestCase(SambaToolCmdTest):
                                                                os.environ["DC_PASSWORD"]))
 
         self.assertCmdSuccess(result, out, err)
                                                                os.environ["DC_PASSWORD"]))
 
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
         self.assertIn("modified cn=uid,CN=Schema,CN=Configuration,DC=samba,DC=example,DC=com", out)
 
         (result, out, err) = self.runsublevelcmd("schema", ("attribute",
         self.assertIn("modified cn=uid,CN=Schema,CN=Configuration,DC=samba,DC=example,DC=com", out)
 
         (result, out, err) = self.runsublevelcmd("schema", ("attribute",
@@ -82,7 +82,7 @@ class SchemaCmdTestCase(SambaToolCmdTest):
                                                                os.environ["DC_PASSWORD"]))
 
         self.assertCmdSuccess(result, out, err)
                                                                os.environ["DC_PASSWORD"]))
 
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
         self.assertIn("modified cn=uid,CN=Schema,CN=Configuration,DC=samba,DC=example,DC=com", out)
 
     def test_show_oc_attribute(self):
         self.assertIn("modified cn=uid,CN=Schema,CN=Configuration,DC=samba,DC=example,DC=com", out)
 
     def test_show_oc_attribute(self):
@@ -94,7 +94,7 @@ class SchemaCmdTestCase(SambaToolCmdTest):
                                                                os.environ["DC_PASSWORD"]))
 
         self.assertCmdSuccess(result, out, err)
                                                                os.environ["DC_PASSWORD"]))
 
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
         self.assertIn("--- MAY contain ---", out)
         self.assertIn("--- MUST contain ---", out)
 
         self.assertIn("--- MAY contain ---", out)
         self.assertIn("--- MUST contain ---", out)
 
@@ -107,7 +107,7 @@ class SchemaCmdTestCase(SambaToolCmdTest):
                                                                os.environ["DC_PASSWORD"]))
 
         self.assertCmdSuccess(result, out, err)
                                                                os.environ["DC_PASSWORD"]))
 
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
         self.assertIn("dn: CN=Person,CN=Schema,CN=Configuration,DC=samba,DC=example,DC=com", out)
 
 
         self.assertIn("dn: CN=Person,CN=Schema,CN=Configuration,DC=samba,DC=example,DC=com", out)
 
 
index 4d264b4027d4880e43a4e393fea7f9ee424f76b2..4d39e822720b5053fd3c82d9b0aae1951be1c3d8 100644 (file)
@@ -52,7 +52,7 @@ class UserCmdTestCase(SambaToolCmdTest):
             (result, out, err) = user["createUserFn"](user)
 
             self.assertCmdSuccess(result, out, err)
             (result, out, err) = user["createUserFn"](user)
 
             self.assertCmdSuccess(result, out, err)
-            self.assertEquals(err,"","Shouldn't be any error messages")
+            self.assertEquals(err, "", "Shouldn't be any error messages")
             self.assertIn("User '%s' created successfully" % user["name"], out)
 
             user["checkUserFn"](user)
             self.assertIn("User '%s' created successfully" % user["name"], out)
 
             user["checkUserFn"](user)
@@ -94,7 +94,7 @@ class UserCmdTestCase(SambaToolCmdTest):
                                                  "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
 
             self.assertCmdSuccess(result, out, err)
                                                  "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
 
             self.assertCmdSuccess(result, out, err)
-            self.assertEquals(err,"","Shouldn't be any error messages")
+            self.assertEquals(err, "", "Shouldn't be any error messages")
             self.assertIn("User '%s' created successfully" % user["name"], out)
 
             found = self._find_user(user["name"])
             self.assertIn("User '%s' created successfully" % user["name"], out)
 
             found = self._find_user(user["name"])
@@ -194,7 +194,7 @@ class UserCmdTestCase(SambaToolCmdTest):
                                                 "-H", "ldap://%s" % os.environ["DC_SERVER"],
                                                 "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
             self.assertCmdSuccess(result, out, err, "Ensure setpassword runs")
                                                 "-H", "ldap://%s" % os.environ["DC_SERVER"],
                                                 "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
             self.assertCmdSuccess(result, out, err, "Ensure setpassword runs")
-            self.assertEquals(err,"","setpassword with url")
+            self.assertEquals(err, "", "setpassword with url")
             self.assertMatch(out, "Changed password OK", "setpassword with url")
 
         attributes = "sAMAccountName,unicodePwd,supplementalCredentials,virtualClearTextUTF8,virtualClearTextUTF16,virtualSSHA,virtualSambaGPG"
             self.assertMatch(out, "Changed password OK", "setpassword with url")
 
         attributes = "sAMAccountName,unicodePwd,supplementalCredentials,virtualClearTextUTF8,virtualClearTextUTF16,virtualSSHA,virtualSambaGPG"
@@ -203,7 +203,7 @@ class UserCmdTestCase(SambaToolCmdTest):
                                             "--attributes=%s" % attributes,
                                             "--decrypt-samba-gpg")
         self.assertCmdSuccess(result, out, err, "Ensure syncpasswords --cache-ldb-initialize runs")
                                             "--attributes=%s" % attributes,
                                             "--decrypt-samba-gpg")
         self.assertCmdSuccess(result, out, err, "Ensure syncpasswords --cache-ldb-initialize runs")
-        self.assertEqual(err,"","getpassword without url")
+        self.assertEqual(err, "", "getpassword without url")
         cache_attrs = {
             "objectClass": {"value": "userSyncPasswords"},
             "samdbUrl": {},
         cache_attrs = {
             "objectClass": {"value": "userSyncPasswords"},
             "samdbUrl": {},
@@ -221,7 +221,7 @@ class UserCmdTestCase(SambaToolCmdTest):
 
         (result, out, err) = self.runsubcmd("user", "syncpasswords", "--no-wait")
         self.assertCmdSuccess(result, out, err, "Ensure syncpasswords --no-wait runs")
 
         (result, out, err) = self.runsubcmd("user", "syncpasswords", "--no-wait")
         self.assertCmdSuccess(result, out, err, "Ensure syncpasswords --no-wait runs")
-        self.assertEqual(err,"","syncpasswords --no-wait")
+        self.assertEqual(err, "", "syncpasswords --no-wait")
         self.assertMatch(out, "dirsync_loop(): results 0",
                          "syncpasswords --no-wait: 'dirsync_loop(): results 0': out[%s]" % (out))
         for user in self.users:
         self.assertMatch(out, "dirsync_loop(): results 0",
                          "syncpasswords --no-wait: 'dirsync_loop(): results 0': out[%s]" % (out))
         for user in self.users:
@@ -242,12 +242,12 @@ class UserCmdTestCase(SambaToolCmdTest):
                                                 user["name"],
                                                 "--newpassword=%s" % newpasswd)
             self.assertCmdSuccess(result, out, err, "Ensure setpassword runs")
                                                 user["name"],
                                                 "--newpassword=%s" % newpasswd)
             self.assertCmdSuccess(result, out, err, "Ensure setpassword runs")
-            self.assertEquals(err,"","setpassword without url")
+            self.assertEquals(err, "", "setpassword without url")
             self.assertMatch(out, "Changed password OK", "setpassword without url")
 
             (result, out, err) = self.runsubcmd("user", "syncpasswords", "--no-wait")
             self.assertCmdSuccess(result, out, err, "Ensure syncpasswords --no-wait runs")
             self.assertMatch(out, "Changed password OK", "setpassword without url")
 
             (result, out, err) = self.runsubcmd("user", "syncpasswords", "--no-wait")
             self.assertCmdSuccess(result, out, err, "Ensure syncpasswords --no-wait runs")
-            self.assertEqual(err,"","syncpasswords --no-wait")
+            self.assertEqual(err, "", "syncpasswords --no-wait")
             self.assertMatch(out, "dirsync_loop(): results 0",
                              "syncpasswords --no-wait: 'dirsync_loop(): results 0': out[%s]" % (out))
             self.assertMatch(out, "sAMAccountName: %s" % (user["name"]),
             self.assertMatch(out, "dirsync_loop(): results 0",
                              "syncpasswords --no-wait: 'dirsync_loop(): results 0': out[%s]" % (out))
             self.assertMatch(out, "sAMAccountName: %s" % (user["name"]),
@@ -273,7 +273,7 @@ class UserCmdTestCase(SambaToolCmdTest):
                                                 "--attributes=%s" % attributes,
                                                 "--decrypt-samba-gpg")
             self.assertCmdSuccess(result, out, err, "Ensure getpassword runs")
                                                 "--attributes=%s" % attributes,
                                                 "--decrypt-samba-gpg")
             self.assertCmdSuccess(result, out, err, "Ensure getpassword runs")
-            self.assertEqual(err,"","getpassword without url")
+            self.assertEqual(err, "", "getpassword without url")
             self.assertMatch(out, "Got password OK", "getpassword without url")
             self.assertMatch(out, "sAMAccountName: %s" % (user["name"]),
                              "getpassword: 'sAMAccountName': %s out[%s]" % (user["name"], out))
             self.assertMatch(out, "Got password OK", "getpassword without url")
             self.assertMatch(out, "sAMAccountName: %s" % (user["name"]),
                              "getpassword: 'sAMAccountName': %s out[%s]" % (user["name"], out))
@@ -299,7 +299,7 @@ class UserCmdTestCase(SambaToolCmdTest):
                                                 "-H", "ldap://%s" % os.environ["DC_SERVER"],
                                                 "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
             self.assertCmdSuccess(result, out, err, "Ensure setpassword runs")
                                                 "-H", "ldap://%s" % os.environ["DC_SERVER"],
                                                 "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
             self.assertCmdSuccess(result, out, err, "Ensure setpassword runs")
-            self.assertEquals(err,"","setpassword with forced change")
+            self.assertEquals(err, "", "setpassword with forced change")
             self.assertMatch(out, "Changed password OK", "setpassword with forced change")
 
 
             self.assertMatch(out, "Changed password OK", "setpassword with forced change")
 
 
@@ -464,7 +464,7 @@ sAMAccountName: %s
                                             "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
 
         self.assertCmdSuccess(result, out, err)
                                             "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
 
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
         self.assertIn("User '%s' created successfully" % user["name"], out)
 
         self._check_posix_user(user)
         self.assertIn("User '%s' created successfully" % user["name"], out)
 
         self._check_posix_user(user)
@@ -493,7 +493,7 @@ sAMAccountName: %s
                                             "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
 
         self.assertCmdSuccess(result, out, err)
                                             "-U%s%%%s" % (os.environ["DC_USERNAME"], os.environ["DC_PASSWORD"]))
 
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
         self.assertIn("User '%s' created successfully" % user["name"], out)
 
         self._check_posix_user(user)
         self.assertIn("User '%s' created successfully" % user["name"], out)
 
         self._check_posix_user(user)
index 02c1e8897f67c559682c14c083bc62205984371b..ed959ee549994aabcf1cb2e73108e3d3a603cf08 100644 (file)
@@ -66,10 +66,10 @@ class SecurityDescriptorTests(samba.tests.TestCase):
         self.assertEquals(desc.type, 0x8004)
 
     def test_from_sddl_invalidsddl(self):
         self.assertEquals(desc.type, 0x8004)
 
     def test_from_sddl_invalidsddl(self):
-        self.assertRaises(TypeError,security.descriptor.from_sddl, "foo",security.dom_sid("S-2-0-0"))
+        self.assertRaises(TypeError, security.descriptor.from_sddl, "foo", security.dom_sid("S-2-0-0"))
 
     def test_from_sddl_invalidtype1(self):
 
     def test_from_sddl_invalidtype1(self):
-        self.assertRaises(TypeError, security.descriptor.from_sddl, security.dom_sid('S-2-0-0-512'),security.dom_sid("S-2-0-0"))
+        self.assertRaises(TypeError, security.descriptor.from_sddl, security.dom_sid('S-2-0-0-512'), security.dom_sid("S-2-0-0"))
 
     def test_from_sddl_invalidtype2(self):
         sddl = "O:AOG:DAD:(A;;RPWPCCDCLCSWRCWDWOGA;;;S-1-0-0)"
 
     def test_from_sddl_invalidtype2(self):
         sddl = "O:AOG:DAD:(A;;RPWPCCDCLCSWRCWDWOGA;;;S-1-0-0)"
@@ -90,7 +90,7 @@ class SecurityDescriptorTests(samba.tests.TestCase):
         text = "O:AOG:DAD:(A;;RPWPCCDCLCSWRCWDWOGA;;;S-1-0-0)"
         dom = security.dom_sid("S-2-0-0")
         desc1 = security.descriptor.from_sddl(text, dom)
         text = "O:AOG:DAD:(A;;RPWPCCDCLCSWRCWDWOGA;;;S-1-0-0)"
         dom = security.dom_sid("S-2-0-0")
         desc1 = security.descriptor.from_sddl(text, dom)
-        self.assertRaises(TypeError, desc1.as_sddl,text)
+        self.assertRaises(TypeError, desc1.as_sddl, text)
 
 
     def test_as_sddl_no_domainsid(self):
 
 
     def test_as_sddl_no_domainsid(self):
index 296815f3a9710bbb4e9df6519b1c563042d0e359..59fd6ed9d41608bcdf995ba9d29aa61092b68662 100644 (file)
@@ -25,7 +25,7 @@ utf_contents = u'Süßigkeiten Ã„pfel ' * 128
 test_literal_bytes_embed_nulls = b'\xff\xfe\x14\x61\x00\x00\x62\x63\x64' * 256
 binary_contents = b'\xff\xfe'
 binary_contents = binary_contents + "Hello cruel world of python3".encode('utf8') * 128
 test_literal_bytes_embed_nulls = b'\xff\xfe\x14\x61\x00\x00\x62\x63\x64' * 256
 binary_contents = b'\xff\xfe'
 binary_contents = binary_contents + "Hello cruel world of python3".encode('utf8') * 128
-test_dir = os.path.join(addom, 'testing_%d' % random.randint(0,0xFFFF))
+test_dir = os.path.join(addom, 'testing_%d' % random.randint(0, 0xFFFF))
 test_file = os.path.join(test_dir, 'testing').replace('/', '\\')
 
 class SMBTests(samba.tests.TestCase):
 test_file = os.path.join(test_dir, 'testing').replace('/', '\\')
 
 class SMBTests(samba.tests.TestCase):
@@ -50,7 +50,7 @@ class SMBTests(samba.tests.TestCase):
         ls = [f['name'] for f in self.conn.list(addom)]
         self.assertIn('scripts', ls,
                       msg='"scripts" directory not found in sysvol')
         ls = [f['name'] for f in self.conn.list(addom)]
         self.assertIn('scripts', ls,
                       msg='"scripts" directory not found in sysvol')
-        self.assertIn('Policies',ls,
+        self.assertIn('Policies', ls,
                       msg='"Policies" directory not found in sysvol')
 
     def test_unlink(self):
                       msg='"Policies" directory not found in sysvol')
 
     def test_unlink(self):
index 9e5239616917981f25e2d7b420e43e735ca457dc..73a3152ca46d9de5e8e5f67a8eed00bfd52cc8e0 100644 (file)
@@ -24,7 +24,7 @@ import shutil
 from samba import param
 from samba.credentials import Credentials
 from samba.auth import system_session
 from samba import param
 from samba.credentials import Credentials
 from samba.auth import system_session
-from samba.provision import getpolicypath,find_provision_key_parameters
+from samba.provision import getpolicypath, find_provision_key_parameters
 from samba.upgradehelpers import (get_paths, get_ldbs,
                                   identic_rename,
                                   updateOEMInfo, getOEMInfo, update_gpo,
 from samba.upgradehelpers import (get_paths, get_ldbs,
                                   identic_rename,
                                   updateOEMInfo, getOEMInfo, update_gpo,
index 18c8afd3f1b5897a6bef969d5163783cc5537625..fe3309af16676c3558b4563bd73f424a15ed0229 100644 (file)
@@ -665,7 +665,7 @@ Please fix this account before attempting to upgrade again
         creds.guess(samba3.lp)
         creds.set_bind_dn(ldapuser)
         creds.set_password(ldappass)
         creds.guess(samba3.lp)
         creds.set_bind_dn(ldapuser)
         creds.set_password(ldappass)
-        urls = samba3.lp.get("passdb backend").split(":",1)[1].strip('"')
+        urls = samba3.lp.get("passdb backend").split(":", 1)[1].strip('"')
         for url in urls.split():
             try:
                 ldb_object = Ldb(url, credentials=creds)
         for url in urls.split():
             try:
                 ldb_object = Ldb(url, credentials=creds)
index 2e6ed1cfdbc1406ffa180bc9d532981a0571b2d9..262f664fc10c7027dc94cf5f991fd47dde81f56e 100644 (file)
@@ -62,8 +62,8 @@ hashAttrNotCopied = set(["dn", "whenCreated", "whenChanged", "objectGUID",
                          "objectCategory", "distinguishedName", "nTMixedDomain",
                          "showInAdvancedViewOnly", "instanceType", "msDS-Behavior-Version",
                          "nextRid", "cn", "versionNumber", "lmPwdHistory", "pwdLastSet",
                          "objectCategory", "distinguishedName", "nTMixedDomain",
                          "showInAdvancedViewOnly", "instanceType", "msDS-Behavior-Version",
                          "nextRid", "cn", "versionNumber", "lmPwdHistory", "pwdLastSet",
-                         "ntPwdHistory", "unicodePwd","dBCSPwd", "supplementalCredentials",
-                         "gPCUserExtensionNames", "gPCMachineExtensionNames","maxPwdAge", "secret",
+                         "ntPwdHistory", "unicodePwd", "dBCSPwd", "supplementalCredentials",
+                         "gPCUserExtensionNames", "gPCMachineExtensionNames", "maxPwdAge", "secret",
                          "possibleInferiors", "privilege", "sAMAccountType"])
 
 
                          "possibleInferiors", "privilege", "sAMAccountType"])
 
 
@@ -221,15 +221,15 @@ def update_policyids(names, samdb):
     # policy guid
     res = samdb.search(expression="(displayName=Default Domain Policy)",
                        base="CN=Policies,CN=System," + str(names.rootdn),
     # policy guid
     res = samdb.search(expression="(displayName=Default Domain Policy)",
                        base="CN=Policies,CN=System," + str(names.rootdn),
-                       scope=SCOPE_ONELEVEL, attrs=["cn","displayName"])
-    names.policyid = str(res[0]["cn"]).replace("{","").replace("}","")
+                       scope=SCOPE_ONELEVEL, attrs=["cn", "displayName"])
+    names.policyid = str(res[0]["cn"]).replace("{", "").replace("}", "")
     # dc policy guid
     res2 = samdb.search(expression="(displayName=Default Domain Controllers"
                                    " Policy)",
                         base="CN=Policies,CN=System," + str(names.rootdn),
     # dc policy guid
     res2 = samdb.search(expression="(displayName=Default Domain Controllers"
                                    " Policy)",
                         base="CN=Policies,CN=System," + str(names.rootdn),
-                        scope=SCOPE_ONELEVEL, attrs=["cn","displayName"])
+                        scope=SCOPE_ONELEVEL, attrs=["cn", "displayName"])
     if len(res2) == 1:
     if len(res2) == 1:
-        names.policyid_dc = str(res2[0]["cn"]).replace("{","").replace("}","")
+        names.policyid_dc = str(res2[0]["cn"]).replace("{", "").replace("}", "")
     else:
         names.policyid_dc = None
 
     else:
         names.policyid_dc = None
 
@@ -290,7 +290,7 @@ def dn_sort(x, y):
             return ret
         else:
             if i == minimum - 1:
             return ret
         else:
             if i == minimum - 1:
-                assert len1 != len2,"PB PB PB" + " ".join(tab1) + " / " + " ".join(tab2)
+                assert len1 != len2, "PB PB PB" + " ".join(tab1) + " / " + " ".join(tab2)
                 if len1 > len2:
                     return 1
                 else:
                 if len1 > len2:
                     return 1
                 else:
@@ -480,7 +480,7 @@ def increment_calculated_keyversion_number(samdb, rootdn, hashDns):
                  have
     """
     entry = samdb.search(expression='(objectClass=user)',
                  have
     """
     entry = samdb.search(expression='(objectClass=user)',
-                         base=ldb.Dn(samdb,str(rootdn)),
+                         base=ldb.Dn(samdb, str(rootdn)),
                          scope=SCOPE_SUBTREE, attrs=["msDs-KeyVersionNumber"],
                          controls=["search_options:1:2"])
     done = 0
                          scope=SCOPE_SUBTREE, attrs=["msDs-KeyVersionNumber"],
                          controls=["search_options:1:2"])
     done = 0
@@ -560,7 +560,7 @@ def construct_existor_expr(attrs):
     if len(attrs) > 0:
         expr = "(|"
         for att in attrs:
     if len(attrs) > 0:
         expr = "(|"
         for att in attrs:
-            expr = "%s(%s=*)" %(expr,att)
+            expr = "%s(%s=*)" %(expr, att)
         expr = "%s)" %expr
     return expr
 
         expr = "%s)" %expr
     return expr
 
@@ -681,7 +681,7 @@ def search_constructed_attrs_stored(samdb, rootdn, attrs):
         return hashAtt
     entry = samdb.search(expression=expr, base=ldb.Dn(samdb, str(rootdn)),
                          scope=SCOPE_SUBTREE, attrs=attrs,
         return hashAtt
     entry = samdb.search(expression=expr, base=ldb.Dn(samdb, str(rootdn)),
                          scope=SCOPE_SUBTREE, attrs=attrs,
-                         controls=["search_options:1:2","bypassoperational:0"])
+                         controls=["search_options:1:2", "bypassoperational:0"])
     if len(entry) == 0:
         # Nothing anymore
         return hashAtt
     if len(entry) == 0:
         # Nothing anymore
         return hashAtt
@@ -809,9 +809,9 @@ def print_provision_ranges(dic, limit_print, dest, samdb_path, invocationid):
         print("To track the USNs modified/created by provision and upgrade proivsion,")
         print(" the following ranges are proposed to be added to your provision sam.ldb: \n%s" % ldif)
         print("We recommend to review them, and if it's correct to integrate the following ldif: %s in your sam.ldb" % file)
         print("To track the USNs modified/created by provision and upgrade proivsion,")
         print(" the following ranges are proposed to be added to your provision sam.ldb: \n%s" % ldif)
         print("We recommend to review them, and if it's correct to integrate the following ldif: %s in your sam.ldb" % file)
-        print("You can load this file like this: ldbadd -H %s %s\n" %(str(samdb_path),file))
+        print("You can load this file like this: ldbadd -H %s %s\n" %(str(samdb_path), file))
         ldif = "dn: @PROVISION\nprovisionnerID: %s\n%s" % (invocationid, ldif)
         ldif = "dn: @PROVISION\nprovisionnerID: %s\n%s" % (invocationid, ldif)
-        open(file,'w').write(ldif)
+        open(file, 'w').write(ldif)
 
 def int64range2str(value):
     """Display the int64 range stored in value as xxx-yyy
 
 def int64range2str(value):
     """Display the int64 range stored in value as xxx-yyy
index 6aa0872953fe12ff1134e79fe435e2ffb25216c0..4344fccfaa7b014f4662f07e6d5ba214c61ab2dd 100644 (file)
@@ -61,7 +61,7 @@ def __call__(environ, start_response):
     if name == "":
         if have_swat:
             start_response('301 Redirect',
     if name == "":
         if have_swat:
             start_response('301 Redirect',
-                           [('Location', urljoin(application_uri(environ), 'swat')),])
+                           [('Location', urljoin(application_uri(environ), 'swat')), ])
             return []
         else:
             return render_placeholder(environ, start_response)
             return []
         else:
             return render_placeholder(environ, start_response)
index 136719009974456416837f81af4f7fbc68d29b51..3a7abeea744b4f9fb056f34aaff586395b8bdba0 100755 (executable)
@@ -4,7 +4,7 @@
 # released under GNU GPL v3 or later
 
 from __future__ import print_function
 # released under GNU GPL v3 or later
 
 from __future__ import print_function
-from subprocess import call, check_call,Popen, PIPE
+from subprocess import call, check_call, Popen, PIPE
 import os, tarfile, sys, time
 from optparse import OptionParser
 import smtplib
 import os, tarfile, sys, time
 from optparse import OptionParser
 import smtplib
@@ -159,7 +159,7 @@ tasks = {
 
     "samba-test-only": [("configure", "./configure.developer --with-selftest-prefix=./bin/ab  --abi-check-disable" + samba_configure_params, "text/plain"),
                           ("make", "make -j", "text/plain"),
 
     "samba-test-only": [("configure", "./configure.developer --with-selftest-prefix=./bin/ab  --abi-check-disable" + samba_configure_params, "text/plain"),
                           ("make", "make -j", "text/plain"),
-                          ("test", 'make test FAIL_IMMEDIATELY=1 TESTS="${TESTS}"',"text/plain")],
+                          ("test", 'make test FAIL_IMMEDIATELY=1 TESTS="${TESTS}"', "text/plain")],
 
     # Test cross-compile infrastructure
     "samba-xc": [("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
 
     # Test cross-compile infrastructure
     "samba-xc": [("random-sleep", "script/random-sleep.sh 60 600", "text/plain"),
index 71c68b0d727816bc07ef6804d44099718dc52509..e06d783411709931e77325f760e3f45f6c915fa9 100755 (executable)
@@ -13,7 +13,7 @@ parser.add_option("", "--good", help="known good revision (default HEAD~100)", d
 parser.add_option("", "--bad", help="known bad revision (default HEAD)", default='HEAD')
 parser.add_option("", "--skip-build-errors", help="skip revision where make fails",
                   action='store_true', default=False)
 parser.add_option("", "--bad", help="known bad revision (default HEAD)", default='HEAD')
 parser.add_option("", "--skip-build-errors", help="skip revision where make fails",
                   action='store_true', default=False)
-parser.add_option("", "--autogen", help="run autogen before each build",action="store_true", default=False)
+parser.add_option("", "--autogen", help="run autogen before each build", action="store_true", default=False)
 parser.add_option("", "--autogen-command", help="command to use for autogen (default ./autogen.sh)",
                   type='str', default="./autogen.sh")
 parser.add_option("", "--configure", help="run configure.developer before each build",
 parser.add_option("", "--autogen-command", help="command to use for autogen (default ./autogen.sh)",
                   type='str', default="./autogen.sh")
 parser.add_option("", "--configure", help="run configure.developer before each build",
index 17b43f08d432d5c84810500787c4862a3b6e60d7..a3a9d113741bbfde73f4ca7cba2e477a768b7f8e 100755 (executable)
@@ -34,7 +34,7 @@ for fname in sys.argv[1:]:
         lines.append(line)
     f.close()
     if base_fname:
         lines.append(line)
     f.close()
     if base_fname:
-        diff = list(difflib.unified_diff(base_lines,lines,base_fname,fname))
+        diff = list(difflib.unified_diff(base_lines, lines, base_fname, fname))
         if diff:
             print('configuration files %s and %s do not match' % (base_fname, fname))
             for l in diff:
         if diff:
             print('configuration files %s and %s do not match' % (base_fname, fname))
             for l in diff:
index cfdaab697891f2937290139f4c0f67bf0cbb25fa..2955d80011cdefa2d13fc2ba6c44ee5e88e7625b 100644 (file)
@@ -199,7 +199,7 @@ def parse_results(msg_ops, statistics, fh):
     return exitcode
 
 
     return exitcode
 
 
-class SubunitOps(TestProtocolClient,TestsuiteEnabledTestResult):
+class SubunitOps(TestProtocolClient, TestsuiteEnabledTestResult):
 
     def progress(self, count, whence):
         if whence == subunit.PROGRESS_POP:
 
     def progress(self, count, whence):
         if whence == subunit.PROGRESS_POP:
index 8e2be886c97ec4ea86549cd911c99be06eac925b..fe488300d4c6091c955d49fb694cd1b2d03156c3 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 from __future__ import print_function
 #!/usr/bin/env python
 
 from __future__ import print_function
-import sys,os,subprocess
+import sys, os, subprocess
 
 
 if len(sys.argv) != 3:
 
 
 if len(sys.argv) != 3:
index 889d49dd405d898632c82a158a25900c261f99ef..09711ce76a67ee8f4e4875d5080838a34b4537a1 100755 (executable)
@@ -101,7 +101,7 @@ plantestsuite("samba3.smbtorture_s3.plain.%s(ad_dc)" % t, "ad_dc", [os.path.join
 #
 # RENAME-ACCESS needs to run against a special share - acl_xattr_ign_sysacl_windows
 #
 #
 # RENAME-ACCESS needs to run against a special share - acl_xattr_ign_sysacl_windows
 #
-plantestsuite("samba3.smbtorture_s3.plain(nt4_dc).%s" % "RENAME-ACCESS","nt4_dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), "RENAME-ACCESS", '//$SERVER_IP/acl_xattr_ign_sysacl_windows', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
+plantestsuite("samba3.smbtorture_s3.plain(nt4_dc).%s" % "RENAME-ACCESS", "nt4_dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), "RENAME-ACCESS", '//$SERVER_IP/acl_xattr_ign_sysacl_windows', '$USERNAME', '$PASSWORD', smbtorture3, "", "-l $LOCAL_PATH"])
 plantestsuite("samba3.smbtorture_s3.crypt_client(nt4_dc).%s" % "RENAME-ACCESS", "nt4_dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), "RENAME-ACCESS", '//$SERVER_IP/acl_xattr_ign_sysacl_windows', '$USERNAME', '$PASSWORD', smbtorture3, "-e", "-l $LOCAL_PATH"])
 # non-crypt only
 
 plantestsuite("samba3.smbtorture_s3.crypt_client(nt4_dc).%s" % "RENAME-ACCESS", "nt4_dc", [os.path.join(samba3srcdir, "script/tests/test_smbtorture_s3.sh"), "RENAME-ACCESS", '//$SERVER_IP/acl_xattr_ign_sysacl_windows', '$USERNAME', '$PASSWORD', smbtorture3, "-e", "-l $LOCAL_PATH"])
 # non-crypt only
 
index 24dcb1c321a147affaa01b6c2c3c4d5aea32e7e1..6eb0b67cb854d187ec17c68908e9568f8f631ce8 100755 (executable)
@@ -53,7 +53,7 @@ else:
 def uniq_list(alist):
     """return a unique list"""
     set = {}
 def uniq_list(alist):
     """return a unique list"""
     set = {}
-    return [set.setdefault(e,e) for e in alist if e not in set]
+    return [set.setdefault(e, e) for e in alist if e not in set]
 
 
 lp_ctx = sambaopts.get_loadparm()
 
 
 lp_ctx = sambaopts.get_loadparm()
@@ -108,7 +108,7 @@ def supclasses(classinfo, oc):
     res = classinfo[oc]["subClassOf"]
     for r in res:
         list.append(r)
     res = classinfo[oc]["subClassOf"]
     for r in res:
         list.append(r)
-        list.extend(supclasses(classinfo,r))
+        list.extend(supclasses(classinfo, r))
     classinfo[oc]["SUPCLASSES"] = list
     return list
 
     classinfo[oc]["SUPCLASSES"] = list
     return list
 
@@ -231,7 +231,7 @@ def test_class(db, classinfo, oc):
         print("Returned incorrect list for objectclass %s" % oc)
         print("search:      %s" % poss1)
         print("constructed: %s" % poss2)
         print("Returned incorrect list for objectclass %s" % oc)
         print("search:      %s" % poss1)
         print("constructed: %s" % poss2)
-        for i in range(0,min(len(poss1),len(poss2))):
+        for i in range(0, min(len(poss1), len(poss2))):
             print("%30s %30s" % (poss1[i], poss2[i]))
         print("]")
         sys.exit(1)
             print("%30s %30s" % (poss1[i], poss2[i]))
         print("]")
         sys.exit(1)
@@ -249,8 +249,8 @@ classinfo = pull_classinfo(db)
 
 if objectclass is None:
     for oc in get_object_classes(db):
 
 if objectclass is None:
     for oc in get_object_classes(db):
-        test_class(db,classinfo,oc)
+        test_class(db, classinfo, oc)
 else:
 else:
-    test_class(db,classinfo,objectclass)
+    test_class(db, classinfo, objectclass)
 
 print("Lists match OK")
 
 print("Lists match OK")
index 92e0a1a7fe4d32cde5e2575a03d60f3c7a9256d0..c6703ca56e4862032c609251de5fed10940e2c5b 100755 (executable)
@@ -1758,7 +1758,7 @@ class AclExtendedTests(AclTests):
         #u3 is member of administrators group, should be able to read sd
         res = self.ldb_user3.search("CN=ext_group1,OU=ext_ou1," + self.base_dn,
                                     SCOPE_BASE, None, ["nTSecurityDescriptor"])
         #u3 is member of administrators group, should be able to read sd
         res = self.ldb_user3.search("CN=ext_group1,OU=ext_ou1," + self.base_dn,
                                     SCOPE_BASE, None, ["nTSecurityDescriptor"])
-        self.assertEqual(len(res),1)
+        self.assertEqual(len(res), 1)
         self.assertTrue("nTSecurityDescriptor" in res[0].keys())
 
 class AclUndeleteTests(AclTests):
         self.assertTrue("nTSecurityDescriptor" in res[0].keys())
 
 class AclUndeleteTests(AclTests):
index ca416e642acdc9661fa70862a4e0165435f77549..01e7a1d237837bc9ae4075392bce540483036fbc 100755 (executable)
@@ -63,7 +63,7 @@ class BaseDeleteTests(samba.tests.TestCase):
         self.assertEquals(len(res), 1)
         return res[0]
 
         self.assertEquals(len(res), 1)
         return res[0]
 
-    def search_dn(self,dn):
+    def search_dn(self, dn):
         print("SEARCH by DN %s" % dn)
 
         res = self.ldb.search(expression="(objectClass=*)",
         print("SEARCH by DN %s" % dn)
 
         res = self.ldb.search(expression="(objectClass=*)",
@@ -83,7 +83,7 @@ class BasicDeleteTests(BaseDeleteTests):
     def del_attr_values(self, delObj):
         print("Checking attributes for %s" % delObj["dn"])
 
     def del_attr_values(self, delObj):
         print("Checking attributes for %s" % delObj["dn"])
 
-        self.assertEquals(delObj["isDeleted"][0],"TRUE")
+        self.assertEquals(delObj["isDeleted"][0], "TRUE")
         self.assertTrue(not("objectCategory" in delObj))
         self.assertTrue(not("sAMAccountType" in delObj))
 
         self.assertTrue(not("objectCategory" in delObj))
         self.assertTrue(not("sAMAccountType" in delObj))
 
index ca3a1e936f6c97aebd6c18762762b855504554f2..71ea23f05e8ce654bdd48473ddb8d9daf164ded4 100755 (executable)
@@ -554,7 +554,7 @@ class SimpleDirsyncTests(DirsyncBaseTests):
         guid = None
         for e in res:
             if str(e["name"]) == "testou3":
         guid = None
         for e in res:
             if str(e["name"]) == "testou3":
-                guid = str(ndr_unpack(misc.GUID,e.get("objectGUID")[0]))
+                guid = str(ndr_unpack(misc.GUID, e.get("objectGUID")[0]))
 
         ctl = str(res.controls[0]).split(":")
         ctl[1] = "1"
 
         ctl = str(res.controls[0]).split(":")
         ctl[1] = "1"
@@ -570,7 +570,7 @@ class SimpleDirsyncTests(DirsyncBaseTests):
                                     expression="(objectClass=organizationalUnit)",
                                     controls=[control1])
         self.assertEqual(len(res), 1)
                                     expression="(objectClass=organizationalUnit)",
                                     controls=[control1])
         self.assertEqual(len(res), 1)
-        guid2 = str(ndr_unpack(misc.GUID,res[0].get("objectGUID")[0]))
+        guid2 = str(ndr_unpack(misc.GUID, res[0].get("objectGUID")[0]))
         self.assertEqual(guid2, guid)
         self.assertTrue(res[0].get("isDeleted"))
         self.assertTrue(res[0].get("name") != None)
         self.assertEqual(guid2, guid)
         self.assertTrue(res[0].get("isDeleted"))
         self.assertTrue(res[0].get("name") != None)
@@ -674,7 +674,7 @@ class ExtendedDirsyncTests(SimpleDirsyncTests):
         guid = None
         for e in res:
             if str(e["name"]) == "testou3":
         guid = None
         for e in res:
             if str(e["name"]) == "testou3":
-                guid = str(ndr_unpack(misc.GUID,e.get("objectGUID")[0]))
+                guid = str(ndr_unpack(misc.GUID, e.get("objectGUID")[0]))
 
         self.assertTrue(guid != None)
         ctl = str(res.controls[0]).split(":")
 
         self.assertTrue(guid != None)
         ctl = str(res.controls[0]).split(":")
@@ -692,7 +692,7 @@ class ExtendedDirsyncTests(SimpleDirsyncTests):
                                      expression="(objectClass=organizationalUnit)",
                                      controls=[control1])
         self.assertEqual(len(res), 1)
                                      expression="(objectClass=organizationalUnit)",
                                      controls=[control1])
         self.assertEqual(len(res), 1)
-        guid2 = str(ndr_unpack(misc.GUID,res[0].get("objectGUID")[0]))
+        guid2 = str(ndr_unpack(misc.GUID, res[0].get("objectGUID")[0]))
         self.assertEqual(guid2, guid)
         self.assertEqual(str(res[0].dn), "")
 
         self.assertEqual(guid2, guid)
         self.assertEqual(str(res[0].dn), "")
 
index 648ee45b22f5f6e4206b61adc20d1b5b698ba6be..a1eba2c0557ac1c63633fea37d93399b586a3b92 100755 (executable)
@@ -112,7 +112,7 @@ objectClass: attributeSchema
 adminDescription: """ + attr_name + """
 adminDisplayName: """ + attr_name + """
 cn: """ + attr_name + """
 adminDescription: """ + attr_name + """
 adminDisplayName: """ + attr_name + """
 cn: """ + attr_name + """
-attributeId: 1.3.6.1.4.1.7165.4.6.1.7.%d.""" % sub_oid + str(random.randint(1,100000)) + """
+attributeId: 1.3.6.1.4.1.7165.4.6.1.7.%d.""" % sub_oid + str(random.randint(1, 100000)) + """
 attributeSyntax: 2.5.5.12
 omSyntax: 64
 instanceType: 4
 attributeSyntax: 2.5.5.12
 omSyntax: 64
 instanceType: 4
@@ -158,7 +158,7 @@ objectClass: classSchema
 adminDescription: """ + class_name + """
 adminDisplayName: """ + class_name + """
 cn: """ + class_name + """
 adminDescription: """ + class_name + """
 adminDisplayName: """ + class_name + """
 cn: """ + class_name + """
-governsId: 1.3.6.1.4.1.7165.4.6.2.7.%d.""" % sub_oid + str(random.randint(1,100000)) + """
+governsId: 1.3.6.1.4.1.7165.4.6.2.7.%d.""" % sub_oid + str(random.randint(1, 100000)) + """
 instanceType: 4
 objectClassCategory: 1
 subClassOf: organizationalPerson
 instanceType: 4
 objectClassCategory: 1
 subClassOf: organizationalPerson
index 9d14e037eb36c7434c7799613279b96c64925f05..6e4d3e3e39b5ef9b20fb8ac9c579e0ab83624d07 100755 (executable)
@@ -728,7 +728,7 @@ class BasicTests(samba.tests.TestCase):
 
         m = Message()
         m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
 
         m = Message()
         m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
-        m["sAMAccountName"] = MessageElement(["nam1","nam2"], FLAG_MOD_REPLACE,
+        m["sAMAccountName"] = MessageElement(["nam1", "nam2"], FLAG_MOD_REPLACE,
                                              "sAMAccountName")
         try:
             ldb.modify(m)
                                              "sAMAccountName")
         try:
             ldb.modify(m)
@@ -1378,7 +1378,7 @@ class BasicTests(samba.tests.TestCase):
         rdn = "CN=a012345678901234567890123456789012345678901234567890123456789012"
         delete_force(self.ldb, "%s,%s" % (rdn, self.base_dn))
         ldif = """
         rdn = "CN=a012345678901234567890123456789012345678901234567890123456789012"
         delete_force(self.ldb, "%s,%s" % (rdn, self.base_dn))
         ldif = """
-dn: %s,%s""" % (rdn,self.base_dn) + """
+dn: %s,%s""" % (rdn, self.base_dn) + """
 objectClass: container
 """
         self.ldb.add_ldif(ldif)
 objectClass: container
 """
         self.ldb.add_ldif(ldif)
@@ -1388,7 +1388,7 @@ objectClass: container
         delete_force(self.ldb, "%s,%s" % (rdn, self.base_dn))
         try:
             ldif = """
         delete_force(self.ldb, "%s,%s" % (rdn, self.base_dn))
         try:
             ldif = """
-dn: %s,%s""" % (rdn,self.base_dn) + """
+dn: %s,%s""" % (rdn, self.base_dn) + """
 objectClass: container
 """
             self.ldb.add_ldif(ldif)
 objectClass: container
 """
             self.ldb.add_ldif(ldif)
@@ -1575,11 +1575,11 @@ objectGUID: bd3480c9-58af-4cd8-92df-bc4a18b6e44d
         """Test parentGUID behaviour"""
         self.ldb.add({
             "dn": "cn=parentguidtest,cn=users," + self.base_dn,
         """Test parentGUID behaviour"""
         self.ldb.add({
             "dn": "cn=parentguidtest,cn=users," + self.base_dn,
-            "objectclass":"user",
-            "samaccountname":"parentguidtest"})
+            "objectclass": "user",
+            "samaccountname": "parentguidtest"})
         res1 = ldb.search(base="cn=parentguidtest,cn=users," + self.base_dn, scope=SCOPE_BASE,
                           attrs=["parentGUID", "samaccountname"])
         res1 = ldb.search(base="cn=parentguidtest,cn=users," + self.base_dn, scope=SCOPE_BASE,
                           attrs=["parentGUID", "samaccountname"])
-        res2 = ldb.search(base="cn=users," + self.base_dn,scope=SCOPE_BASE,
+        res2 = ldb.search(base="cn=users," + self.base_dn, scope=SCOPE_BASE,
                           attrs=["objectGUID"])
         res3 = ldb.search(base=self.base_dn, scope=SCOPE_BASE,
                           attrs=["parentGUID"])
                           attrs=["objectGUID"])
         res3 = ldb.search(base=self.base_dn, scope=SCOPE_BASE,
                           attrs=["parentGUID"])
@@ -1630,8 +1630,8 @@ objectGUID: bd3480c9-58af-4cd8-92df-bc4a18b6e44d
 
         self.ldb.add({
             "dn": "cn=testotherusers," + self.base_dn,
 
         self.ldb.add({
             "dn": "cn=testotherusers," + self.base_dn,
-            "objectclass":"container"})
-        res1 = ldb.search(base="cn=testotherusers," + self.base_dn,scope=SCOPE_BASE,
+            "objectclass": "container"})
+        res1 = ldb.search(base="cn=testotherusers," + self.base_dn, scope=SCOPE_BASE,
                           attrs=["objectGUID"])
         ldb.rename("cn=parentguidtest,cn=users," + self.base_dn,
                    "cn=parentguidtest,cn=testotherusers," + self.base_dn)
                           attrs=["objectGUID"])
         ldb.rename("cn=parentguidtest,cn=users," + self.base_dn,
                    "cn=parentguidtest,cn=testotherusers," + self.base_dn)
@@ -3072,7 +3072,7 @@ nTSecurityDescriptor:: """ + desc_base64
         # there does not seem to be another limitation.
         try:
             dshstr = ""
         # there does not seem to be another limitation.
         try:
             dshstr = ""
-            for i in range(1,11):
+            for i in range(1, 11):
                 # This is in the range
                 self.ldb.set_dsheuristics(dshstr + "x")
                 self.ldb.set_dsheuristics(dshstr + "xxxxx")
                 # This is in the range
                 self.ldb.set_dsheuristics(dshstr + "x")
                 self.ldb.set_dsheuristics(dshstr + "xxxxx")
index e98ab4a5656300e03087061b925717e506eb8323..3d4a9d9f039f27dce46c9d3ed252306b960fc07c 100755 (executable)
@@ -99,7 +99,7 @@ class SchemaTests(samba.tests.TestCase):
 
     def test_schemaUpdateNow(self):
         """Testing schemaUpdateNow"""
 
     def test_schemaUpdateNow(self):
         """Testing schemaUpdateNow"""
-        rand = str(random.randint(1,100000))
+        rand = str(random.randint(1, 100000))
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
 
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
 
@@ -131,7 +131,7 @@ schemaUpdateNow: 1
         # Search for created attribute
         res = []
         res = self.ldb.search("cn=%s,%s" % (attr_name, self.schema_dn), scope=SCOPE_BASE,
         # Search for created attribute
         res = []
         res = self.ldb.search("cn=%s,%s" % (attr_name, self.schema_dn), scope=SCOPE_BASE,
-                              attrs=["lDAPDisplayName","schemaIDGUID", "msDS-IntID"])
+                              attrs=["lDAPDisplayName", "schemaIDGUID", "msDS-IntID"])
         self.assertEquals(len(res), 1)
         self.assertEquals(res[0]["lDAPDisplayName"][0], attr_ldap_display_name)
         self.assertTrue("schemaIDGUID" in res[0])
         self.assertEquals(len(res), 1)
         self.assertEquals(res[0]["lDAPDisplayName"][0], attr_ldap_display_name)
         self.assertTrue("schemaIDGUID" in res[0])
@@ -154,7 +154,7 @@ defaultObjectCategory: CN=_
 adminDescription: """ + class_name + """
 adminDisplayName: """ + class_name + """
 cn: """ + class_name + """
 adminDescription: """ + class_name + """
 adminDisplayName: """ + class_name + """
 cn: """ + class_name + """
-governsId: 1.3.6.1.4.1.7165.4.6.2.6.1.""" + str(random.randint(1,100000)) + """
+governsId: 1.3.6.1.4.1.7165.4.6.2.6.1.""" + str(random.randint(1, 100000)) + """
 instanceType: 4
 objectClassCategory: 1
 subClassOf: organizationalPerson
 instanceType: 4
 objectClassCategory: 1
 subClassOf: organizationalPerson
@@ -178,7 +178,7 @@ objectClass: classSchema
 adminDescription: """ + class_name + """
 adminDisplayName: """ + class_name + """
 cn: """ + class_name + """
 adminDescription: """ + class_name + """
 adminDisplayName: """ + class_name + """
 cn: """ + class_name + """
-governsId: 1.3.6.1.4.1.7165.4.6.2.6.2.""" + str(random.randint(1,100000)) + """
+governsId: 1.3.6.1.4.1.7165.4.6.2.6.2.""" + str(random.randint(1, 100000)) + """
 instanceType: 4
 objectClassCategory: 1
 subClassOf: organizationalPerson
 instanceType: 4
 objectClassCategory: 1
 subClassOf: organizationalPerson
@@ -260,7 +260,7 @@ objectClass: classSchema
 adminDescription: """ + class_name + """
 adminDisplayName: """ + class_name + """
 cn: """ + class_name + """
 adminDescription: """ + class_name + """
 adminDisplayName: """ + class_name + """
 cn: """ + class_name + """
-governsId: 1.3.6.1.4.1.7165.4.6.2.6.3.""" + str(random.randint(1,100000)) + """
+governsId: 1.3.6.1.4.1.7165.4.6.2.6.3.""" + str(random.randint(1, 100000)) + """
 instanceType: 4
 objectClassCategory: 1
 subClassOf: organizationalUnit
 instanceType: 4
 objectClassCategory: 1
 subClassOf: organizationalUnit
@@ -307,7 +307,7 @@ instanceType: 4
 
     def test_duplicate_attributeID(self):
         """Testing creating a duplicate attribute"""
 
     def test_duplicate_attributeID(self):
         """Testing creating a duplicate attribute"""
-        rand = str(random.randint(1,100000))
+        rand = str(random.randint(1, 100000))
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.2." + rand
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.2." + rand
@@ -351,7 +351,7 @@ systemOnly: FALSE
 
     def test_duplicate_attributeID_governsID(self):
         """Testing creating a duplicate attribute and class"""
 
     def test_duplicate_attributeID_governsID(self):
         """Testing creating a duplicate attribute and class"""
-        rand = str(random.randint(1,100000))
+        rand = str(random.randint(1, 100000))
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.3." + rand
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.3." + rand
@@ -396,7 +396,7 @@ systemOnly: FALSE
 
     def test_duplicate_cn(self):
         """Testing creating a duplicate attribute"""
 
     def test_duplicate_cn(self):
         """Testing creating a duplicate attribute"""
-        rand = str(random.randint(1,100000))
+        rand = str(random.randint(1, 100000))
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.4." + rand
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.4." + rand
@@ -439,7 +439,7 @@ systemOnly: FALSE
 
     def test_duplicate_implicit_ldapdisplayname(self):
         """Testing creating a duplicate attribute ldapdisplayname"""
 
     def test_duplicate_implicit_ldapdisplayname(self):
         """Testing creating a duplicate attribute ldapdisplayname"""
-        rand = str(random.randint(1,100000))
+        rand = str(random.randint(1, 100000))
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.5." + rand
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.5." + rand
@@ -484,7 +484,7 @@ systemOnly: FALSE
 
     def test_duplicate_explicit_ldapdisplayname(self):
         """Testing creating a duplicate attribute ldapdisplayname"""
 
     def test_duplicate_explicit_ldapdisplayname(self):
         """Testing creating a duplicate attribute ldapdisplayname"""
-        rand = str(random.randint(1,100000))
+        rand = str(random.randint(1, 100000))
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.6." + rand
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.6." + rand
@@ -531,7 +531,7 @@ systemOnly: FALSE
     def test_duplicate_explicit_ldapdisplayname_with_class(self):
         """Testing creating a duplicate attribute ldapdisplayname between
         and attribute and a class"""
     def test_duplicate_explicit_ldapdisplayname_with_class(self):
         """Testing creating a duplicate attribute ldapdisplayname between
         and attribute and a class"""
-        rand = str(random.randint(1,100000))
+        rand = str(random.randint(1, 100000))
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.7." + rand
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.7." + rand
@@ -579,7 +579,7 @@ systemOnly: FALSE
 
     def test_duplicate_via_rename_ldapdisplayname(self):
         """Testing creating a duplicate attribute ldapdisplayname"""
 
     def test_duplicate_via_rename_ldapdisplayname(self):
         """Testing creating a duplicate attribute ldapdisplayname"""
-        rand = str(random.randint(1,100000))
+        rand = str(random.randint(1, 100000))
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.8." + rand
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.8." + rand
@@ -634,7 +634,7 @@ ldapDisplayName: """ + attr_ldap_display_name + """
 
     def test_duplicate_via_rename_attributeID(self):
         """Testing creating a duplicate attributeID"""
 
     def test_duplicate_via_rename_attributeID(self):
         """Testing creating a duplicate attributeID"""
-        rand = str(random.randint(1,100000))
+        rand = str(random.randint(1, 100000))
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.9." + rand
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.9." + rand
@@ -688,7 +688,7 @@ attributeId: """ + attributeID + """
 
     def test_remove_ldapdisplayname(self):
         """Testing removing the ldapdisplayname"""
 
     def test_remove_ldapdisplayname(self):
         """Testing removing the ldapdisplayname"""
-        rand = str(random.randint(1,100000))
+        rand = str(random.randint(1, 100000))
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.10." + rand
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.10." + rand
@@ -724,7 +724,7 @@ replace: ldapDisplayName
 
     def test_rename_ldapdisplayname(self):
         """Testing renaming ldapdisplayname"""
 
     def test_rename_ldapdisplayname(self):
         """Testing renaming ldapdisplayname"""
-        rand = str(random.randint(1,100000))
+        rand = str(random.randint(1, 100000))
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.11." + rand
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.11." + rand
@@ -757,7 +757,7 @@ ldapDisplayName: """ + attr_ldap_display_name + """2
 
     def test_change_attributeID(self):
         """Testing change the attributeID"""
 
     def test_change_attributeID(self):
         """Testing change the attributeID"""
-        rand = str(random.randint(1,100000))
+        rand = str(random.randint(1, 100000))
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.12." + rand
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.12." + rand
@@ -795,7 +795,7 @@ attributeId: """ + attributeID + """.1
 
     def test_change_attributeID_same(self):
         """Testing change the attributeID to the same value"""
 
     def test_change_attributeID_same(self):
         """Testing change the attributeID to the same value"""
-        rand = str(random.randint(1,100000))
+        rand = str(random.randint(1, 100000))
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.13." + rand
         attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name = attr_name.replace("-", "")
         attributeID = "1.3.6.1.4.1.7165.4.6.1.6.13." + rand
@@ -849,7 +849,7 @@ attributeId: """ + attributeID + """
         if dc_level < DS_DOMAIN_FUNCTION_2003:
             return
 
         if dc_level < DS_DOMAIN_FUNCTION_2003:
             return
 
-        rand = str(random.randint(1,100000))
+        rand = str(random.randint(1, 100000))
 
         attr_name_1 = "test-generated-linkID" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name_1 = attr_name_1.replace("-", "")
 
         attr_name_1 = "test-generated-linkID" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name_1 = attr_name_1.replace("-", "")
@@ -1130,7 +1130,7 @@ systemOnly: FALSE
         duplicate mAPIIDs.
         """
 
         duplicate mAPIIDs.
         """
 
-        rand = str(random.randint(1,100000))
+        rand = str(random.randint(1, 100000))
 
         attr_name_1 = "test-generated-mAPIID" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name_1 = attr_name_1.replace("-", "")
 
         attr_name_1 = "test-generated-mAPIID" + time.strftime("%s", time.gmtime()) + "-" + rand
         attr_ldap_display_name_1 = attr_name_1.replace("-", "")
@@ -1203,7 +1203,7 @@ systemOnly: FALSE
 
     def test_change_governsID(self):
         """Testing change the governsID"""
 
     def test_change_governsID(self):
         """Testing change the governsID"""
-        rand = str(random.randint(1,100000))
+        rand = str(random.randint(1, 100000))
         class_name = "test-Class" + time.strftime("%s", time.gmtime()) + "-" + rand
         class_ldap_display_name = class_name.replace("-", "")
         governsID = "1.3.6.1.4.1.7165.4.6.2.6.5." + rand
         class_name = "test-Class" + time.strftime("%s", time.gmtime()) + "-" + rand
         class_ldap_display_name = class_name.replace("-", "")
         governsID = "1.3.6.1.4.1.7165.4.6.2.6.5." + rand
@@ -1242,7 +1242,7 @@ governsId: """ + governsID + """.1
 
     def test_change_governsID_same(self):
         """Testing change the governsID"""
 
     def test_change_governsID_same(self):
         """Testing change the governsID"""
-        rand = str(random.randint(1,100000))
+        rand = str(random.randint(1, 100000))
         class_name = "test-Class" + time.strftime("%s", time.gmtime()) + "-" + rand
         class_ldap_display_name = class_name.replace("-", "")
         governsID = "1.3.6.1.4.1.7165.4.6.2.6.6." + rand
         class_name = "test-Class" + time.strftime("%s", time.gmtime()) + "-" + rand
         class_ldap_display_name = class_name.replace("-", "")
         governsID = "1.3.6.1.4.1.7165.4.6.2.6.6." + rand
@@ -1293,7 +1293,7 @@ objectClass: classSchema
 adminDescription: """ + class_name + """
 adminDisplayName: """ + class_name + """
 cn: """ + class_name + """
 adminDescription: """ + class_name + """
 adminDisplayName: """ + class_name + """
 cn: """ + class_name + """
-governsId: 1.3.6.1.4.1.7165.4.6.2.6.7.""" + str(random.randint(1,100000)) + """
+governsId: 1.3.6.1.4.1.7165.4.6.2.6.7.""" + str(random.randint(1, 100000)) + """
 instanceType: 4
 objectClassCategory: 1
 subClassOf: organizationalUnit
 instanceType: 4
 objectClassCategory: 1
 subClassOf: organizationalUnit
@@ -1382,7 +1382,7 @@ objectClass: attributeSchema
 adminDescription: """ + attr_name + """
 adminDisplayName: """ + attr_name + """
 cn: """ + attr_name + """
 adminDescription: """ + attr_name + """
 adminDisplayName: """ + attr_name + """
 cn: """ + attr_name + """
-attributeId: 1.3.6.1.4.1.7165.4.6.1.6.14.""" + str(random.randint(1,100000)) + """
+attributeId: 1.3.6.1.4.1.7165.4.6.1.6.14.""" + str(random.randint(1, 100000)) + """
 attributeSyntax: 2.5.5.12
 omSyntax: 64
 instanceType: 4
 attributeSyntax: 2.5.5.12
 omSyntax: 64
 instanceType: 4
@@ -1502,7 +1502,7 @@ objectClass: classSchema
 adminDescription: """ + class_name + """
 adminDisplayName: """ + class_name + """
 cn: """ + class_name + """
 adminDescription: """ + class_name + """
 adminDisplayName: """ + class_name + """
 cn: """ + class_name + """
-governsId: 1.3.6.1.4.1.7165.4.6.2.6.%d.""" % sub_oid + str(random.randint(1,100000)) + """
+governsId: 1.3.6.1.4.1.7165.4.6.2.6.%d.""" % sub_oid + str(random.randint(1, 100000)) + """
 instanceType: 4
 objectClassCategory: 1
 subClassOf: organizationalPerson
 instanceType: 4
 objectClassCategory: 1
 subClassOf: organizationalPerson
@@ -1654,7 +1654,7 @@ class SchemaTests_msDS_isRODC(samba.tests.TestCase):
 
     def test_objectClass_computer(self):
         res = self.ldb.search(self.base_dn, expression="objectClass=computer",
 
     def test_objectClass_computer(self):
         res = self.ldb.search(self.base_dn, expression="objectClass=computer",
-                              attrs=["serverReferenceBL","msDS-isRODC"], controls=["search_options:1:2"])
+                              attrs=["serverReferenceBL", "msDS-isRODC"], controls=["search_options:1:2"])
         for ldb_msg in res:
             if "serverReferenceBL" not in ldb_msg:
                 print("Computer entry %s doesn't have a serverReferenceBL attribute" % ldb_msg['dn'])
         for ldb_msg in res:
             if "serverReferenceBL" not in ldb_msg:
                 print("Computer entry %s doesn't have a serverReferenceBL attribute" % ldb_msg['dn'])
index ab6bc7c9b60b6dcc503e4a497154ae163ac2bea9..932d3d8d00cc05cebed9c58e88b3783351077fd6 100755 (executable)
@@ -65,7 +65,7 @@ ldapDisplayName: """ + attr_ldap_display_name + """
 objectClass: top
 objectClass: attributeSchema
 cn: """ + attr_name + """
 objectClass: top
 objectClass: attributeSchema
 cn: """ + attr_name + """
-attributeId: 1.3.6.1.4.1.7165.4.6.1.1.""" + str(random.randint(1,100000)) + """
+attributeId: 1.3.6.1.4.1.7165.4.6.1.1.""" + str(random.randint(1, 100000)) + """
 attributeSyntax: 2.5.5.14
 omSyntax: 127
 omObjectClass: \x2A\x86\x48\x86\xF7\x14\x01\x01\x01\x0C
 attributeSyntax: 2.5.5.14
 omSyntax: 127
 omObjectClass: \x2A\x86\x48\x86\xF7\x14\x01\x01\x01\x0C
@@ -92,7 +92,7 @@ objectClass: classSchema
 adminDescription: """ + class_name + """
 adminDisplayName: """ + class_name + """
 cn: """ + class_name + """
 adminDescription: """ + class_name + """
 adminDisplayName: """ + class_name + """
 cn: """ + class_name + """
-governsId: 1.3.6.1.4.1.7165.4.6.2.1.""" + str(random.randint(1,100000)) + """
+governsId: 1.3.6.1.4.1.7165.4.6.2.1.""" + str(random.randint(1, 100000)) + """
 schemaIdGuid: """ + str(uuid.uuid4()) + """
 objectClassCategory: 1
 subClassOf: organizationalPerson
 schemaIdGuid: """ + str(uuid.uuid4()) + """
 objectClassCategory: 1
 subClassOf: organizationalPerson
@@ -125,7 +125,7 @@ ldapDisplayName: """ + attr_ldap_display_name + """
 objectClass: top
 objectClass: attributeSchema
 cn: """ + attr_name + """
 objectClass: top
 objectClass: attributeSchema
 cn: """ + attr_name + """
-attributeId: 1.3.6.1.4.1.7165.4.6.1.2.""" + str(random.randint(1,100000)) + """
+attributeId: 1.3.6.1.4.1.7165.4.6.1.2.""" + str(random.randint(1, 100000)) + """
 attributeSyntax: 2.5.5.7
 omSyntax: 127
 omObjectClass: \x2A\x86\x48\x86\xF7\x14\x01\x01\x01\x0B
 attributeSyntax: 2.5.5.7
 omSyntax: 127
 omObjectClass: \x2A\x86\x48\x86\xF7\x14\x01\x01\x01\x0B
@@ -152,7 +152,7 @@ objectClass: classSchema
 adminDescription: """ + class_name + """
 adminDisplayName: """ + class_name + """
 cn: """ + class_name + """
 adminDescription: """ + class_name + """
 adminDisplayName: """ + class_name + """
 cn: """ + class_name + """
-governsId: 1.3.6.1.4.1.7165.4.6.2.2.""" + str(random.randint(1,100000)) + """
+governsId: 1.3.6.1.4.1.7165.4.6.2.2.""" + str(random.randint(1, 100000)) + """
 schemaIdGuid: """ + str(uuid.uuid4()) + """
 objectClassCategory: 1
 subClassOf: organizationalPerson
 schemaIdGuid: """ + str(uuid.uuid4()) + """
 objectClassCategory: 1
 subClassOf: organizationalPerson
index 58876680d860b975dda17013cc5b2258883fe8e0..83910c784a8798b8faa6a34af08e0c9f1b86f4ae 100644 (file)
@@ -331,7 +331,7 @@ class LATests(samba.tests.TestCase):
         # removing a duplicate link in the same message should fail
         self.add_linked_attribute(g2, [u1, u2])
         self.assertRaises(ldb.LdbError,
         # removing a duplicate link in the same message should fail
         self.add_linked_attribute(g2, [u1, u2])
         self.assertRaises(ldb.LdbError,
-                          self.remove_linked_attribute,g2, [u1, u1])
+                          self.remove_linked_attribute, g2, [u1, u1])
 
     def _test_la_links_delete_link_reveal(self):
         u1, u2 = self.add_objects(2, 'user', 'u_del_link_reveal')
 
     def _test_la_links_delete_link_reveal(self):
         u1, u2 = self.add_objects(2, 'user', 'u_del_link_reveal')
index 716bcdda1fabe01e123edc889bf774d4d0059221..50f722d57b5e321180419fc3105b988358c080e5 100644 (file)
@@ -97,7 +97,7 @@ def preload_rodc_user(user_dn):
            'rodc', 'preload',
            user_dn,
            credstring,
            'rodc', 'preload',
            user_dn,
            credstring,
-           '--server', RWDC,]
+           '--server', RWDC, ]
 
     print(' '.join(cmd))
     subprocess.check_call(cmd)
 
     print(' '.join(cmd))
     subprocess.check_call(cmd)
index a1806f9bae303aae2a997d25a6423d73d94aa0d2..77fd8f5b659ae566be8d3e3ce8cf2678bb6ec7a2 100755 (executable)
@@ -3451,7 +3451,7 @@ class SamTests(samba.tests.TestCase):
 
         m = Message()
         m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
 
         m = Message()
         m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
-        m["description"] = MessageElement(["desc1","desc2"], FLAG_MOD_REPLACE,
+        m["description"] = MessageElement(["desc1", "desc2"], FLAG_MOD_REPLACE,
                                           "description")
         try:
             ldb.modify(m)
                                           "description")
         try:
             ldb.modify(m)
@@ -3462,7 +3462,7 @@ class SamTests(samba.tests.TestCase):
 
         m = Message()
         m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
 
         m = Message()
         m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
-        m["description"] = MessageElement(["desc1","desc2"], FLAG_MOD_DELETE,
+        m["description"] = MessageElement(["desc1", "desc2"], FLAG_MOD_DELETE,
                                           "description")
         ldb.modify(m)
 
                                           "description")
         ldb.modify(m)
 
@@ -3518,7 +3518,7 @@ class SamTests(samba.tests.TestCase):
 
         m = Message()
         m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
 
         m = Message()
         m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
-        m["description"] = MessageElement(["desc1","desc2"], FLAG_MOD_DELETE,
+        m["description"] = MessageElement(["desc1", "desc2"], FLAG_MOD_DELETE,
                                           "description")
         try:
             ldb.modify(m)
                                           "description")
         try:
             ldb.modify(m)
@@ -3539,7 +3539,7 @@ class SamTests(samba.tests.TestCase):
 
         m = Message()
         m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
 
         m = Message()
         m.dn = Dn(ldb, "cn=ldaptestgroup,cn=users," + self.base_dn)
-        m["description"] = MessageElement(["desc1","desc2"], FLAG_MOD_REPLACE,
+        m["description"] = MessageElement(["desc1", "desc2"], FLAG_MOD_REPLACE,
                                           "description")
         try:
             ldb.modify(m)
                                           "description")
         try:
             ldb.modify(m)
@@ -3673,11 +3673,11 @@ class SamTests(samba.tests.TestCase):
         # a list of some well-known sids
         # objects in Builtin are aready covered by objectclass
         protected_list = [
         # a list of some well-known sids
         # objects in Builtin are aready covered by objectclass
         protected_list = [
-            ["CN=Domain Admins","CN=Users,"],
-            ["CN=Schema Admins","CN=Users,"],
-            ["CN=Enterprise Admins","CN=Users,"],
-            ["CN=Administrator","CN=Users,"],
-            ["CN=Domain Controllers","CN=Users,"],
+            ["CN=Domain Admins", "CN=Users,"],
+            ["CN=Schema Admins", "CN=Users,"],
+            ["CN=Enterprise Admins", "CN=Users,"],
+            ["CN=Administrator", "CN=Users,"],
+            ["CN=Domain Controllers", "CN=Users,"],
         ]
 
 
         ]
 
 
@@ -3720,7 +3720,7 @@ class SamTests(samba.tests.TestCase):
                           "logonCount": MessageElement(["0"]),
                           "cn": MessageElement([user_name]),
                           "countryCode": MessageElement(["0"]),
                           "logonCount": MessageElement(["0"]),
                           "cn": MessageElement([user_name]),
                           "countryCode": MessageElement(["0"]),
-                          "objectClass": MessageElement(["top","person","organizationalPerson","user"]),
+                          "objectClass": MessageElement(["top", "person", "organizationalPerson", "user"]),
                           "instanceType": MessageElement(["4"]),
                           "distinguishedName": MessageElement([user_dn]),
                           "sAMAccountType": MessageElement(["805306368"]),
                           "instanceType": MessageElement(["4"]),
                           "distinguishedName": MessageElement([user_dn]),
                           "sAMAccountType": MessageElement(["805306368"]),
index b35529bd9b5a43c2a21cf445e1cef7bf3ee36892..7b9f6083f8241dd017c6bbb48f7d9eb2788d0611 100755 (executable)
@@ -67,7 +67,7 @@ class DescriptorTests(samba.tests.TestCase):
 
     def create_schema_class(self, _ldb, desc=None):
         while True:
 
     def create_schema_class(self, _ldb, desc=None):
         while True:
-            class_id = random.randint(0,65535)
+            class_id = random.randint(0, 65535)
             class_name = "descriptor-test-class%s" % class_id
             class_dn = "CN=%s,%s" % (class_name, self.schema_dn)
             try:
             class_name = "descriptor-test-class%s" % class_id
             class_dn = "CN=%s,%s" % (class_name, self.schema_dn)
             try:
@@ -212,10 +212,10 @@ class OwnerGroupDescriptorTests(DescriptorTests):
                                                 ["testuser1", "testuser5", "testuser6", "testuser8"],
                                                 add_members_operation=True)
         self.ldb_admin.add_remove_group_members("Domain Admins",
                                                 ["testuser1", "testuser5", "testuser6", "testuser8"],
                                                 add_members_operation=True)
         self.ldb_admin.add_remove_group_members("Domain Admins",
-                                                ["testuser2","testuser5","testuser6","testuser7"],
+                                                ["testuser2", "testuser5", "testuser6", "testuser7"],
                                                 add_members_operation=True)
         self.ldb_admin.add_remove_group_members("Schema Admins",
                                                 add_members_operation=True)
         self.ldb_admin.add_remove_group_members("Schema Admins",
-                                                ["testuser3","testuser6","testuser7","testuser8"],
+                                                ["testuser3", "testuser6", "testuser7", "testuser8"],
                                                 add_members_operation=True)
 
         self.results = {
                                                 add_members_operation=True)
 
         self.results = {
@@ -2082,7 +2082,7 @@ class SdAutoInheritTests(DescriptorTests):
         sd_sddl = "O:BAG:BAD:P(A;CI;0x000f01ff;;;AU)"
         sd = security.descriptor.from_sddl(sd_sddl, self.domain_sid)
 
         sd_sddl = "O:BAG:BAD:P(A;CI;0x000f01ff;;;AU)"
         sd = security.descriptor.from_sddl(sd_sddl, self.domain_sid)
 
-        self.ldb_admin.create_ou(self.ou_dn,sd=sd)
+        self.ldb_admin.create_ou(self.ou_dn, sd=sd)
         self.ldb_admin.create_ou(self.sub_dn)
 
         ou_res0 = self.sd_utils.ldb.search(self.ou_dn, SCOPE_BASE,
         self.ldb_admin.create_ou(self.sub_dn)
 
         ou_res0 = self.sd_utils.ldb.search(self.ou_dn, SCOPE_BASE,
index 191df0d2996af85e822ea885b09d53f8fb9b2aff..5d8282ba9ade541b0522c3762c0769d7319b2084 100755 (executable)
@@ -54,9 +54,9 @@ class UrgentReplicationTests(samba.tests.TestCase):
         """Test if the urgent replication is not activated when handling a non urgent object."""
         self.ldb.add({
             "dn": "cn=nonurgenttest,cn=users," + self.base_dn,
         """Test if the urgent replication is not activated when handling a non urgent object."""
         self.ldb.add({
             "dn": "cn=nonurgenttest,cn=users," + self.base_dn,
-            "objectclass":"user",
-            "samaccountname":"nonurgenttest",
-            "description":"nonurgenttest description"})
+            "objectclass": "user",
+            "samaccountname": "nonurgenttest",
+            "description": "nonurgenttest description"})
 
         # urgent replication should not be enabled when creating
         res = self.ldb.load_partition_usn(self.base_dn)
 
         # urgent replication should not be enabled when creating
         res = self.ldb.load_partition_usn(self.base_dn)
@@ -81,10 +81,10 @@ class UrgentReplicationTests(samba.tests.TestCase):
         self.ldb.add({
             "dn": "cn=test server,cn=Servers,cn=Default-First-Site-Name,cn=Sites,%s" %
             self.ldb.get_config_basedn(),
         self.ldb.add({
             "dn": "cn=test server,cn=Servers,cn=Default-First-Site-Name,cn=Sites,%s" %
             self.ldb.get_config_basedn(),
-            "objectclass":"server",
-            "cn":"test server",
-            "name":"test server",
-            "systemFlags":"50000000"}, ["relax:0"])
+            "objectclass": "server",
+            "cn": "test server",
+            "name": "test server",
+            "systemFlags": "50000000"}, ["relax:0"])
 
         self.ldb.add_ldif(
             """dn: cn=NTDS Settings test,cn=test server,cn=Servers,cn=Default-First-Site-Name,cn=Sites,cn=Configuration,%s""" % (self.base_dn) + """
 
         self.ldb.add_ldif(
             """dn: cn=NTDS Settings test,cn=test server,cn=Servers,cn=Default-First-Site-Name,cn=Sites,cn=Configuration,%s""" % (self.base_dn) + """
@@ -156,7 +156,7 @@ cn: test attributeSchema
 instanceType: 4
 isSingleValued: FALSE
 showInAdvancedViewOnly: FALSE
 instanceType: 4
 isSingleValued: FALSE
 showInAdvancedViewOnly: FALSE
-attributeID: 1.3.6.1.4.1.7165.4.6.1.4.""" + str(random.randint(1,100000)) + """
+attributeID: 1.3.6.1.4.1.7165.4.6.1.4.""" + str(random.randint(1, 100000)) + """
 attributeSyntax: 2.5.5.12
 adminDisplayName: test attributeSchema
 adminDescription: test attributeSchema
 attributeSyntax: 2.5.5.12
 adminDisplayName: test attributeSchema
 adminDescription: test attributeSchema
@@ -188,7 +188,7 @@ objectClass: classSchema
 cn: test classSchema
 instanceType: 4
 subClassOf: top
 cn: test classSchema
 instanceType: 4
 subClassOf: top
-governsId: 1.3.6.1.4.1.7165.4.6.2.4.""" + str(random.randint(1,100000)) + """
+governsId: 1.3.6.1.4.1.7165.4.6.2.4.""" + str(random.randint(1, 100000)) + """
 rDNAttID: cn
 showInAdvancedViewOnly: TRUE
 adminDisplayName: test classSchema
 rDNAttID: cn
 showInAdvancedViewOnly: TRUE
 adminDisplayName: test classSchema
@@ -225,10 +225,10 @@ defaultHidingValue: TRUE""")
 
         self.ldb.add({
             "dn": "cn=test secret,cn=System," + self.base_dn,
 
         self.ldb.add({
             "dn": "cn=test secret,cn=System," + self.base_dn,
-            "objectClass":"secret",
-            "cn":"test secret",
-            "name":"test secret",
-            "currentValue":"xxxxxxx"})
+            "objectClass": "secret",
+            "cn": "test secret",
+            "name": "test secret",
+            "currentValue": "xxxxxxx"})
 
         # urgent replication should be enabled when creating
         res = self.ldb.load_partition_usn(self.base_dn)
 
         # urgent replication should be enabled when creating
         res = self.ldb.load_partition_usn(self.base_dn)
@@ -284,12 +284,12 @@ rIDAvailablePool: 133001-1073741823""", ["relax:0"])
 
         self.ldb.add({
             "dn": "cn=user UrgAttr test,cn=users," + self.base_dn,
 
         self.ldb.add({
             "dn": "cn=user UrgAttr test,cn=users," + self.base_dn,
-            "objectclass":"user",
-            "samaccountname":"user UrgAttr test",
-            "userAccountControl":str(dsdb.UF_NORMAL_ACCOUNT),
-            "lockoutTime":"0",
-            "pwdLastSet":"0",
-            "description":"urgent attributes test description"})
+            "objectclass": "user",
+            "samaccountname": "user UrgAttr test",
+            "userAccountControl": str(dsdb.UF_NORMAL_ACCOUNT),
+            "lockoutTime": "0",
+            "pwdLastSet": "0",
+            "description": "urgent attributes test description"})
 
         # urgent replication should NOT be enabled when creating
         res = self.ldb.load_partition_usn(self.base_dn)
 
         # urgent replication should NOT be enabled when creating
         res = self.ldb.load_partition_usn(self.base_dn)
index c60e0854344fd7753c6fc71c83c79b3aaa3c9b06..6a53e5bef6b74a82131ab98e7e56f0a67c5d9fce 100755 (executable)
@@ -34,7 +34,7 @@ from ldb import SCOPE_SUBTREE, SCOPE_BASE, LdbError
 from ldb import Message, MessageElement, Dn
 from ldb import FLAG_MOD_ADD, FLAG_MOD_REPLACE, FLAG_MOD_DELETE
 from samba.dsdb import UF_SCRIPT, UF_ACCOUNTDISABLE, UF_00000004, UF_HOMEDIR_REQUIRED, \
 from ldb import Message, MessageElement, Dn
 from ldb import FLAG_MOD_ADD, FLAG_MOD_REPLACE, FLAG_MOD_DELETE
 from samba.dsdb import UF_SCRIPT, UF_ACCOUNTDISABLE, UF_00000004, UF_HOMEDIR_REQUIRED, \
-    UF_LOCKOUT,UF_PASSWD_NOTREQD, UF_PASSWD_CANT_CHANGE, UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED,\
+    UF_LOCKOUT, UF_PASSWD_NOTREQD, UF_PASSWD_CANT_CHANGE, UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED,\
     UF_TEMP_DUPLICATE_ACCOUNT, UF_NORMAL_ACCOUNT, UF_00000400, UF_INTERDOMAIN_TRUST_ACCOUNT, \
     UF_WORKSTATION_TRUST_ACCOUNT, UF_SERVER_TRUST_ACCOUNT, UF_00004000, \
     UF_00008000, UF_DONT_EXPIRE_PASSWD, UF_MNS_LOGON_ACCOUNT, UF_SMARTCARD_REQUIRED, \
     UF_TEMP_DUPLICATE_ACCOUNT, UF_NORMAL_ACCOUNT, UF_00000400, UF_INTERDOMAIN_TRUST_ACCOUNT, \
     UF_WORKSTATION_TRUST_ACCOUNT, UF_SERVER_TRUST_ACCOUNT, UF_00004000, \
     UF_00008000, UF_DONT_EXPIRE_PASSWD, UF_MNS_LOGON_ACCOUNT, UF_SMARTCARD_REQUIRED, \
@@ -70,7 +70,7 @@ creds = credopts.get_credentials(lp)
 creds.set_gensec_features(creds.get_gensec_features() | gensec.FEATURE_SEAL)
 
 bits = [UF_SCRIPT, UF_ACCOUNTDISABLE, UF_00000004, UF_HOMEDIR_REQUIRED,
 creds.set_gensec_features(creds.get_gensec_features() | gensec.FEATURE_SEAL)
 
 bits = [UF_SCRIPT, UF_ACCOUNTDISABLE, UF_00000004, UF_HOMEDIR_REQUIRED,
-        UF_LOCKOUT,UF_PASSWD_NOTREQD, UF_PASSWD_CANT_CHANGE,
+        UF_LOCKOUT, UF_PASSWD_NOTREQD, UF_PASSWD_CANT_CHANGE,
         UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED,
         UF_TEMP_DUPLICATE_ACCOUNT, UF_NORMAL_ACCOUNT, UF_00000400,
         UF_INTERDOMAIN_TRUST_ACCOUNT,
         UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED,
         UF_TEMP_DUPLICATE_ACCOUNT, UF_NORMAL_ACCOUNT, UF_00000400,
         UF_INTERDOMAIN_TRUST_ACCOUNT,
index c552c06ad574505765856e77ac7c630e616cfcc1..bdb0dd12461848db760e1c7fda8e5caeaa18e9f6 100644 (file)
@@ -10,25 +10,25 @@ try:
     _swig_property = property
 except NameError:
     pass # Python < 2.2 doesn't have 'property'.
     _swig_property = property
 except NameError:
     pass # Python < 2.2 doesn't have 'property'.
-def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
+def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
     if (name == "thisown"): return self.this.own(value)
     if (name == "this"):
         if type(value).__name__ == 'PySwigObject':
             self.__dict__[name] = value
             return
     if (name == "thisown"): return self.this.own(value)
     if (name == "this"):
         if type(value).__name__ == 'PySwigObject':
             self.__dict__[name] = value
             return
-    method = class_type.__swig_setmethods__.get(name,None)
-    if method: return method(self,value)
-    if (not static) or hasattr(self,name):
+    method = class_type.__swig_setmethods__.get(name, None)
+    if method: return method(self, value)
+    if (not static) or hasattr(self, name):
         self.__dict__[name] = value
     else:
         raise AttributeError("You cannot add attributes to %s" % self)
 
         self.__dict__[name] = value
     else:
         raise AttributeError("You cannot add attributes to %s" % self)
 
-def _swig_setattr(self,class_type,name,value):
-    return _swig_setattr_nondynamic(self,class_type,name,value,0)
+def _swig_setattr(self, class_type, name, value):
+    return _swig_setattr_nondynamic(self, class_type, name, value, 0)
 
 
-def _swig_getattr(self,class_type,name):
+def _swig_getattr(self, class_type, name):
     if (name == "thisown"): return self.this.own()
     if (name == "thisown"): return self.this.own()
-    method = class_type.__swig_getmethods__.get(name,None)
+    method = class_type.__swig_getmethods__.get(name, None)
     if method: return method(self)
     raise AttributeError(name)
 
     if method: return method(self)
     raise AttributeError(name)
 
@@ -48,10 +48,10 @@ del types
 
 
 def _swig_setattr_nondynamic_method(set):
 
 
 def _swig_setattr_nondynamic_method(set):
-    def set_attr(self,name,value):
+    def set_attr(self, name, value):
         if (name == "thisown"): return self.this.own(value)
         if (name == "thisown"): return self.this.own(value)
-        if hasattr(self,name) or (name == "this"):
-            set(self,name,value)
+        if hasattr(self, name) or (name == "this"):
+            set(self, name, value)
         else:
             raise AttributeError("You cannot add attributes to %s" % self)
     return set_attr
         else:
             raise AttributeError("You cannot add attributes to %s" % self)
     return set_attr
@@ -62,9 +62,9 @@ class IUnknown(object):
     thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
     __repr__ = _swig_repr
     def __init__(self, *args, **kwargs): 
     thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
     __repr__ = _swig_repr
     def __init__(self, *args, **kwargs): 
-        _wmi.IUnknown_swiginit(self,_wmi.new_IUnknown(*args, **kwargs))
+        _wmi.IUnknown_swiginit(self, _wmi.new_IUnknown(*args, **kwargs))
     __swig_destroy__ = _wmi.delete_IUnknown
     __swig_destroy__ = _wmi.delete_IUnknown
-IUnknown.Release = new_instancemethod(_wmi.IUnknown_Release,None,IUnknown)
+IUnknown.Release = new_instancemethod(_wmi.IUnknown_Release, None, IUnknown)
 IUnknown_swigregister = _wmi.IUnknown_swigregister
 IUnknown_swigregister(IUnknown)
 
 IUnknown_swigregister = _wmi.IUnknown_swigregister
 IUnknown_swigregister(IUnknown)
 
@@ -72,11 +72,11 @@ class IWbemServices(object):
     thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
     __repr__ = _swig_repr
     def __init__(self, *args, **kwargs): 
     thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
     __repr__ = _swig_repr
     def __init__(self, *args, **kwargs): 
-        _wmi.IWbemServices_swiginit(self,_wmi.new_IWbemServices(*args, **kwargs))
+        _wmi.IWbemServices_swiginit(self, _wmi.new_IWbemServices(*args, **kwargs))
     __swig_destroy__ = _wmi.delete_IWbemServices
     __swig_destroy__ = _wmi.delete_IWbemServices
-IWbemServices.ExecQuery = new_instancemethod(_wmi.IWbemServices_ExecQuery,None,IWbemServices)
-IWbemServices.ExecNotificationQuery = new_instancemethod(_wmi.IWbemServices_ExecNotificationQuery,None,IWbemServices)
-IWbemServices.CreateInstanceEnum = new_instancemethod(_wmi.IWbemServices_CreateInstanceEnum,None,IWbemServices)
+IWbemServices.ExecQuery = new_instancemethod(_wmi.IWbemServices_ExecQuery, None, IWbemServices)
+IWbemServices.ExecNotificationQuery = new_instancemethod(_wmi.IWbemServices_ExecNotificationQuery, None, IWbemServices)
+IWbemServices.CreateInstanceEnum = new_instancemethod(_wmi.IWbemServices_CreateInstanceEnum, None, IWbemServices)
 IWbemServices_swigregister = _wmi.IWbemServices_swigregister
 IWbemServices_swigregister(IWbemServices)
 
 IWbemServices_swigregister = _wmi.IWbemServices_swigregister
 IWbemServices_swigregister(IWbemServices)
 
@@ -84,9 +84,9 @@ class IEnumWbemClassObject(object):
     thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
     __repr__ = _swig_repr
     def __init__(self, *args, **kwargs): 
     thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
     __repr__ = _swig_repr
     def __init__(self, *args, **kwargs): 
-        _wmi.IEnumWbemClassObject_swiginit(self,_wmi.new_IEnumWbemClassObject(*args, **kwargs))
+        _wmi.IEnumWbemClassObject_swiginit(self, _wmi.new_IEnumWbemClassObject(*args, **kwargs))
     __swig_destroy__ = _wmi.delete_IEnumWbemClassObject
     __swig_destroy__ = _wmi.delete_IEnumWbemClassObject
-IEnumWbemClassObject.Reset = new_instancemethod(_wmi.IEnumWbemClassObject_Reset,None,IEnumWbemClassObject)
+IEnumWbemClassObject.Reset = new_instancemethod(_wmi.IEnumWbemClassObject_Reset, None, IEnumWbemClassObject)
 IEnumWbemClassObject_swigregister = _wmi.IEnumWbemClassObject_swigregister
 IEnumWbemClassObject_swigregister(IEnumWbemClassObject)
 
 IEnumWbemClassObject_swigregister = _wmi.IEnumWbemClassObject_swigregister
 IEnumWbemClassObject_swigregister(IEnumWbemClassObject)
 
index e8acb90c90fa548fd814b9e6d886d769dc81405e..1c5100b629c3f02e510faf9fec3776bd1e2e427c 100755 (executable)
@@ -72,7 +72,7 @@ class globals:
             continue
         self.global_objs = {}
 
             continue
         self.global_objs = {}
 
-def attid_equal(a1,a2):
+def attid_equal(a1, a2):
     return (a1 & 0xffffffff) == (a2 & 0xffffffff)
 
 ########### main code ###########
     return (a1 & 0xffffffff) == (a2 & 0xffffffff)
 
 ########### main code ###########
index 86d3520c0d98abf2966383cc097fb34bea5c7ac9..fbbf67e31220e7e95fd6fa1c962d2d26488d91ca 100755 (executable)
@@ -76,7 +76,7 @@ class SpeedTest(samba.tests.TestCase):
 
     def find_domain_sid(self, ldb):
         res = ldb.search(base=self.base_dn, expression="(objectClass=*)", scope=SCOPE_BASE)
 
     def find_domain_sid(self, ldb):
         res = ldb.search(base=self.base_dn, expression="(objectClass=*)", scope=SCOPE_BASE)
-        return ndr_unpack(security.dom_sid,res[0]["objectSid"][0])
+        return ndr_unpack(security.dom_sid, res[0]["objectSid"][0])
 
     def setUp(self):
         super(SpeedTest, self).setUp()
 
     def setUp(self):
         super(SpeedTest, self).setUp()
index 89acae305e01ee46533a90abd629bb239520e820..c92c8b1805e270446af41ce4acc2e27822cbb482 100755 (executable)
@@ -204,7 +204,7 @@ for transport in ["ncacn_np", "ncacn_ip_tcp"]:
         bindoptions = ''
         if t == 'rpc.cracknames':
             bindoptions = 'seal'
         bindoptions = ''
         if t == 'rpc.cracknames':
             bindoptions = 'seal'
-        plansmbtorture4testsuite(t, env, ["%s:$SERVER[%s]" % (transport,bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s on %s with %s" % (t, transport, bindoptions))
+        plansmbtorture4testsuite(t, env, ["%s:$SERVER[%s]" % (transport, bindoptions), '-U$USERNAME%$PASSWORD', '--workgroup=$DOMAIN'], "samba4.%s on %s with %s" % (t, transport, bindoptions))
 
 # Tests for the DFS referral calls implementation
 for t in smbtorture4_testsuites("dfs."):
 
 # Tests for the DFS referral calls implementation
 for t in smbtorture4_testsuites("dfs."):
@@ -557,7 +557,7 @@ for env in ["s4member_dflt_domain", "s4member"]:
         if env == "s4member":
             users = ["$DOMAIN/$DC_USERNAME", "$DC_USERNAME@$REALM"]
         for usr in users:
         if env == "s4member":
             users = ["$DOMAIN/$DC_USERNAME", "$DC_USERNAME@$REALM"]
         for usr in users:
-            plantestsuite("samba4.winbind.dom_name_parse.cmd", env, "%s/dom_parse.sh %s %s" % (bbdir,cmd,usr))
+            plantestsuite("samba4.winbind.dom_name_parse.cmd", env, "%s/dom_parse.sh %s %s" % (bbdir, cmd, usr))
 
 nsstest4 = binpath("nsstest")
 for env in ["ad_dc:local", "s4member:local", "nt4_dc:local", "ad_member:local", "nt4_member:local"]:
 
 nsstest4 = binpath("nsstest")
 for env in ["ad_dc:local", "s4member:local", "nt4_dc:local", "ad_member:local", "nt4_member:local"]:
index 4cbe2e858d71ad8092a7bfd232cb50bfb5671647..5cc0c2877c820bf5c46d5b8c8b4776612f950beb 100644 (file)
@@ -74,7 +74,7 @@ class DrsDeleteObjectTestCase(drs_base.DrsBaseTestCase):
         name_orig = obj_orig["name"][0]
         name_cur  = user_cur["name"][0]
         if is_deleted:
         name_orig = obj_orig["name"][0]
         name_cur  = user_cur["name"][0]
         if is_deleted:
-            self.assertEquals(user_cur["isDeleted"][0],"TRUE")
+            self.assertEquals(user_cur["isDeleted"][0], "TRUE")
             self.assertFalse("objectCategory" in user_cur)
             self.assertFalse("sAMAccountType" in user_cur)
             self.assertFalse("description" in user_cur)
             self.assertFalse("objectCategory" in user_cur)
             self.assertFalse("sAMAccountType" in user_cur)
             self.assertFalse("description" in user_cur)
index c84e819fc21453a448528d5b070290b73b176afe..45308e451fe545a2a085a406f5b846571914ba4e 100644 (file)
@@ -141,7 +141,7 @@ class DrsBaseTestCase(SambaToolCmdTest):
 
         (result, out, err) = self.runsubcmd(*samba_tool_cmdline)
         self.assertCmdSuccess(result, out, err)
 
         (result, out, err) = self.runsubcmd(*samba_tool_cmdline)
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
 
     def _enable_inbound_repl(self, DC):
         # make base command line
 
     def _enable_inbound_repl(self, DC):
         # make base command line
@@ -150,7 +150,7 @@ class DrsBaseTestCase(SambaToolCmdTest):
         samba_tool_cmd += [DC, "--dsa-option=-DISABLE_INBOUND_REPL"]
         (result, out, err) = self.runsubcmd(*samba_tool_cmd)
         self.assertCmdSuccess(result, out, err)
         samba_tool_cmd += [DC, "--dsa-option=-DISABLE_INBOUND_REPL"]
         (result, out, err) = self.runsubcmd(*samba_tool_cmd)
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
 
     def _disable_inbound_repl(self, DC):
         # make base command line
 
     def _disable_inbound_repl(self, DC):
         # make base command line
@@ -159,7 +159,7 @@ class DrsBaseTestCase(SambaToolCmdTest):
         samba_tool_cmd += [DC, "--dsa-option=+DISABLE_INBOUND_REPL"]
         (result, out, err) = self.runsubcmd(*samba_tool_cmd)
         self.assertCmdSuccess(result, out, err)
         samba_tool_cmd += [DC, "--dsa-option=+DISABLE_INBOUND_REPL"]
         (result, out, err) = self.runsubcmd(*samba_tool_cmd)
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
 
     def _enable_all_repl(self, DC):
         self._enable_inbound_repl(DC)
 
     def _enable_all_repl(self, DC):
         self._enable_inbound_repl(DC)
@@ -169,7 +169,7 @@ class DrsBaseTestCase(SambaToolCmdTest):
         samba_tool_cmd += [DC, "--dsa-option=-DISABLE_OUTBOUND_REPL"]
         (result, out, err) = self.runsubcmd(*samba_tool_cmd)
         self.assertCmdSuccess(result, out, err)
         samba_tool_cmd += [DC, "--dsa-option=-DISABLE_OUTBOUND_REPL"]
         (result, out, err) = self.runsubcmd(*samba_tool_cmd)
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
 
     def _disable_all_repl(self, DC):
         self._disable_inbound_repl(DC)
 
     def _disable_all_repl(self, DC):
         self._disable_inbound_repl(DC)
@@ -179,7 +179,7 @@ class DrsBaseTestCase(SambaToolCmdTest):
         samba_tool_cmd += [DC, "--dsa-option=+DISABLE_OUTBOUND_REPL"]
         (result, out, err) = self.runsubcmd(*samba_tool_cmd)
         self.assertCmdSuccess(result, out, err)
         samba_tool_cmd += [DC, "--dsa-option=+DISABLE_OUTBOUND_REPL"]
         (result, out, err) = self.runsubcmd(*samba_tool_cmd)
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
 
     def _get_highest_hwm_utdv(self, ldb_conn):
         res = ldb_conn.search("", scope=ldb.SCOPE_BASE, attrs=["highestCommittedUSN"])
 
     def _get_highest_hwm_utdv(self, ldb_conn):
         res = ldb_conn.search("", scope=ldb.SCOPE_BASE, attrs=["highestCommittedUSN"])
index 67b8331614d60de06ce7d680bde6d3332db7112e..c74bb9d1ec138e278fe2c90935099244387835a6 100644 (file)
@@ -67,7 +67,7 @@ class DrsFsmoTestCase(drs_base.DrsBaseTestCase):
                                             cmd_line_auth)
 
         self.assertCmdSuccess(result, out, err)
                                             cmd_line_auth)
 
         self.assertCmdSuccess(result, out, err)
-        self.assertEquals(err,"","Shouldn't be any error messages")
+        self.assertEquals(err, "", "Shouldn't be any error messages")
         if noop == False:
             self.assertTrue("FSMO transfer of '%s' role successful" % role in out)
         else:
         if noop == False:
             self.assertTrue("FSMO transfer of '%s' role successful" % role in out)
         else:
index 21c7a1853dc1aeead2348200bc7d56133e08ca99..111264b36bcee71cc08e5ed7b107e1e74f2fbd25 100644 (file)
@@ -263,17 +263,17 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase):
         })
         dc3_id = self._get_identifier(self.ldb_dc1, dc3)
 
         })
         dc3_id = self._get_identifier(self.ldb_dc1, dc3)
 
-        (hwm1, utdv1) = self._check_replication([ou1,ou2,dc3],
+        (hwm1, utdv1) = self._check_replication([ou1, ou2, dc3],
                                                 drsuapi.DRSUAPI_DRS_WRIT_REP)
 
                                                 drsuapi.DRSUAPI_DRS_WRIT_REP)
 
-        self._check_replication([ou1,ou2,dc3],
+        self._check_replication([ou1, ou2, dc3],
                                 drsuapi.DRSUAPI_DRS_WRIT_REP |
                                 drsuapi.DRSUAPI_DRS_GET_ANC)
 
         self._check_replication([dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY)
 
                                 drsuapi.DRSUAPI_DRS_WRIT_REP |
                                 drsuapi.DRSUAPI_DRS_GET_ANC)
 
         self._check_replication([dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY)
 
-        self._check_replication([ou1,ou2,dc3],
+        self._check_replication([ou1, ou2, dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY |
                                 drsuapi.DRSUAPI_DRS_GET_ANC)
 
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY |
                                 drsuapi.DRSUAPI_DRS_GET_ANC)
 
@@ -282,17 +282,17 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase):
         m["displayName"] = ldb.MessageElement("OU1", ldb.FLAG_MOD_ADD, "displayName")
         self.ldb_dc1.modify(m)
 
         m["displayName"] = ldb.MessageElement("OU1", ldb.FLAG_MOD_ADD, "displayName")
         self.ldb_dc1.modify(m)
 
-        (hwm2, utdv2) = self._check_replication([ou2,dc3,ou1],
+        (hwm2, utdv2) = self._check_replication([ou2, dc3, ou1],
                                                 drsuapi.DRSUAPI_DRS_WRIT_REP)
 
                                                 drsuapi.DRSUAPI_DRS_WRIT_REP)
 
-        self._check_replication([ou1,ou2,dc3],
+        self._check_replication([ou1, ou2, dc3],
                                 drsuapi.DRSUAPI_DRS_WRIT_REP |
                                 drsuapi.DRSUAPI_DRS_GET_ANC)
 
         self._check_replication([dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY)
 
                                 drsuapi.DRSUAPI_DRS_WRIT_REP |
                                 drsuapi.DRSUAPI_DRS_GET_ANC)
 
         self._check_replication([dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY)
 
-        self._check_replication([ou1,ou2,dc3],
+        self._check_replication([ou1, ou2, dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY |
                                 drsuapi.DRSUAPI_DRS_GET_ANC)
 
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY |
                                 drsuapi.DRSUAPI_DRS_GET_ANC)
 
@@ -315,30 +315,30 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase):
         m["displayName"] = ldb.MessageElement("OU2", ldb.FLAG_MOD_ADD, "displayName")
         self.ldb_dc1.modify(m)
 
         m["displayName"] = ldb.MessageElement("OU2", ldb.FLAG_MOD_ADD, "displayName")
         self.ldb_dc1.modify(m)
 
-        (hwm3, utdv3) = self._check_replication([dc3,ou1,ou2],
+        (hwm3, utdv3) = self._check_replication([dc3, ou1, ou2],
                                                 drsuapi.DRSUAPI_DRS_WRIT_REP)
 
                                                 drsuapi.DRSUAPI_DRS_WRIT_REP)
 
-        self._check_replication([ou1,ou2,dc3],
+        self._check_replication([ou1, ou2, dc3],
                                 drsuapi.DRSUAPI_DRS_WRIT_REP |
                                 drsuapi.DRSUAPI_DRS_GET_ANC)
 
         self._check_replication([dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY)
 
                                 drsuapi.DRSUAPI_DRS_WRIT_REP |
                                 drsuapi.DRSUAPI_DRS_GET_ANC)
 
         self._check_replication([dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY)
 
-        self._check_replication([ou1,ou2,dc3],
+        self._check_replication([ou1, ou2, dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY |
                                 drsuapi.DRSUAPI_DRS_GET_ANC)
 
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY |
                                 drsuapi.DRSUAPI_DRS_GET_ANC)
 
-        self._check_replication([ou1,ou2],
+        self._check_replication([ou1, ou2],
                                 drsuapi.DRSUAPI_DRS_WRIT_REP,
                                 highwatermark=hwm1)
 
                                 drsuapi.DRSUAPI_DRS_WRIT_REP,
                                 highwatermark=hwm1)
 
-        self._check_replication([ou1,ou2],
+        self._check_replication([ou1, ou2],
                                 drsuapi.DRSUAPI_DRS_WRIT_REP |
                                 drsuapi.DRSUAPI_DRS_GET_ANC,
                                 highwatermark=hwm1)
 
                                 drsuapi.DRSUAPI_DRS_WRIT_REP |
                                 drsuapi.DRSUAPI_DRS_GET_ANC,
                                 highwatermark=hwm1)
 
-        self._check_replication([ou1,ou2],
+        self._check_replication([ou1, ou2],
                                 drsuapi.DRSUAPI_DRS_WRIT_REP |
                                 drsuapi.DRSUAPI_DRS_GET_ANC,
                                 uptodateness_vector=utdv1)
                                 drsuapi.DRSUAPI_DRS_WRIT_REP |
                                 drsuapi.DRSUAPI_DRS_GET_ANC,
                                 uptodateness_vector=utdv1)
@@ -348,21 +348,21 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase):
         m["displayName"] = ldb.MessageElement("OU", ldb.FLAG_MOD_ADD, "displayName")
         self.ldb_dc1.modify(m)
 
         m["displayName"] = ldb.MessageElement("OU", ldb.FLAG_MOD_ADD, "displayName")
         self.ldb_dc1.modify(m)
 
-        (hwm4, utdv4) = self._check_replication([dc3,ou1,ou2,self.ou],
+        (hwm4, utdv4) = self._check_replication([dc3, ou1, ou2, self.ou],
                                                 drsuapi.DRSUAPI_DRS_WRIT_REP)
 
                                                 drsuapi.DRSUAPI_DRS_WRIT_REP)
 
-        self._check_replication([self.ou,ou1,ou2,dc3],
+        self._check_replication([self.ou, ou1, ou2, dc3],
                                 drsuapi.DRSUAPI_DRS_WRIT_REP |
                                 drsuapi.DRSUAPI_DRS_GET_ANC)
 
         self._check_replication([dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY)
 
                                 drsuapi.DRSUAPI_DRS_WRIT_REP |
                                 drsuapi.DRSUAPI_DRS_GET_ANC)
 
         self._check_replication([dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY)
 
-        self._check_replication([self.ou,ou1,ou2,dc3],
+        self._check_replication([self.ou, ou1, ou2, dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY |
                                 drsuapi.DRSUAPI_DRS_GET_ANC)
 
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY |
                                 drsuapi.DRSUAPI_DRS_GET_ANC)
 
-        self._check_replication([self.ou,ou2],
+        self._check_replication([self.ou, ou2],
                                 drsuapi.DRSUAPI_DRS_WRIT_REP |
                                 drsuapi.DRSUAPI_DRS_GET_ANC,
                                 uptodateness_vector=utdv2)
                                 drsuapi.DRSUAPI_DRS_WRIT_REP |
                                 drsuapi.DRSUAPI_DRS_GET_ANC,
                                 uptodateness_vector=utdv2)
@@ -374,17 +374,17 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase):
         })
         cn3_id = self._get_identifier(self.ldb_dc1, cn3)
 
         })
         cn3_id = self._get_identifier(self.ldb_dc1, cn3)
 
-        (hwm5, utdv5) = self._check_replication([dc3,ou1,ou2,self.ou,cn3],
+        (hwm5, utdv5) = self._check_replication([dc3, ou1, ou2, self.ou, cn3],
                                                 drsuapi.DRSUAPI_DRS_WRIT_REP)
 
                                                 drsuapi.DRSUAPI_DRS_WRIT_REP)
 
-        self._check_replication([self.ou,ou1,ou2,dc3,cn3],
+        self._check_replication([self.ou, ou1, ou2, dc3, cn3],
                                 drsuapi.DRSUAPI_DRS_WRIT_REP |
                                 drsuapi.DRSUAPI_DRS_GET_ANC)
 
         self._check_replication([dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY)
 
                                 drsuapi.DRSUAPI_DRS_WRIT_REP |
                                 drsuapi.DRSUAPI_DRS_GET_ANC)
 
         self._check_replication([dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY)
 
-        self._check_replication([self.ou,ou1,ou2,dc3],
+        self._check_replication([self.ou, ou1, ou2, dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY |
                                 drsuapi.DRSUAPI_DRS_GET_ANC)
 
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY |
                                 drsuapi.DRSUAPI_DRS_GET_ANC)
 
@@ -396,12 +396,12 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase):
                                          drsuapi.DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE,
                                          ou2_id.guid, dc3_id.guid)
 
                                          drsuapi.DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE,
                                          ou2_id.guid, dc3_id.guid)
 
-        (hwm6, utdv6) = self._check_replication([dc3,ou1,self.ou,cn3,ou2],
+        (hwm6, utdv6) = self._check_replication([dc3, ou1, self.ou, cn3, ou2],
                                                 drsuapi.DRSUAPI_DRS_WRIT_REP,
                                                 expected_links=[ou2_managedBy_dc3])
 
         # Can fail against Windows due to equal precedence of dc3, cn3
                                                 drsuapi.DRSUAPI_DRS_WRIT_REP,
                                                 expected_links=[ou2_managedBy_dc3])
 
         # Can fail against Windows due to equal precedence of dc3, cn3
-        self._check_replication([self.ou,ou1,ou2,dc3,cn3],
+        self._check_replication([self.ou, ou1, ou2, dc3, cn3],
                                 drsuapi.DRSUAPI_DRS_WRIT_REP |
                                 drsuapi.DRSUAPI_DRS_GET_ANC,
                                 expected_links=[ou2_managedBy_dc3])
                                 drsuapi.DRSUAPI_DRS_WRIT_REP |
                                 drsuapi.DRSUAPI_DRS_GET_ANC,
                                 expected_links=[ou2_managedBy_dc3])
@@ -409,7 +409,7 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase):
         self._check_replication([dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY)
 
         self._check_replication([dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY)
 
-        self._check_replication([self.ou,ou1,ou2,dc3],
+        self._check_replication([self.ou, ou1, ou2, dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY |
                                 drsuapi.DRSUAPI_DRS_GET_ANC)
 
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY |
                                 drsuapi.DRSUAPI_DRS_GET_ANC)
 
@@ -434,9 +434,9 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase):
                                          drsuapi.DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE,
                                          dc3_id.guid, ou1_id.guid)
 
                                          drsuapi.DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE,
                                          dc3_id.guid, ou1_id.guid)
 
-        (hwm7, utdv7) = self._check_replication([ou1,self.ou,cn3,ou2,dc3],
+        (hwm7, utdv7) = self._check_replication([ou1, self.ou, cn3, ou2, dc3],
                                                 drsuapi.DRSUAPI_DRS_WRIT_REP,
                                                 drsuapi.DRSUAPI_DRS_WRIT_REP,
-                                                expected_links=[ou2_managedBy_dc3,dc3_managedBy_ou1])
+                                                expected_links=[ou2_managedBy_dc3, dc3_managedBy_ou1])
 
         # Can fail against Windows due to equal precedence of dc3, cn3
         #self._check_replication([self.ou,ou1,ou2,dc3,cn3],
 
         # Can fail against Windows due to equal precedence of dc3, cn3
         #self._check_replication([self.ou,ou1,ou2,dc3,cn3],
@@ -452,7 +452,7 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase):
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY,
                                 expected_links=[dc3_managedBy_ou1])
 
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY,
                                 expected_links=[dc3_managedBy_ou1])
 
-        self._check_replication([self.ou,ou1,ou2,dc3],
+        self._check_replication([self.ou, ou1, ou2, dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY |
                                 drsuapi.DRSUAPI_DRS_GET_ANC,
                                 expected_links=[dc3_managedBy_ou1])
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY |
                                 drsuapi.DRSUAPI_DRS_GET_ANC,
                                 expected_links=[dc3_managedBy_ou1])
@@ -476,9 +476,9 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase):
                                          drsuapi.DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE,
                                          dc3_id.guid, ou2_id.guid)
 
                                          drsuapi.DRSUAPI_DS_LINKED_ATTRIBUTE_FLAG_ACTIVE,
                                          dc3_id.guid, ou2_id.guid)
 
-        (hwm8, utdv8) = self._check_replication([ou1,self.ou,cn3,ou2,dc3],
+        (hwm8, utdv8) = self._check_replication([ou1, self.ou, cn3, ou2, dc3],
                                                 drsuapi.DRSUAPI_DRS_WRIT_REP,
                                                 drsuapi.DRSUAPI_DRS_WRIT_REP,
-                                                expected_links=[ou2_managedBy_dc3,dc3_managedBy_ou1,dc3_managedBy_ou2])
+                                                expected_links=[ou2_managedBy_dc3, dc3_managedBy_ou1, dc3_managedBy_ou2])
 
         # Can fail against Windows due to equal precedence of dc3, cn3
         #self._check_replication([self.ou,ou1,ou2,dc3,cn3],
 
         # Can fail against Windows due to equal precedence of dc3, cn3
         #self._check_replication([self.ou,ou1,ou2,dc3,cn3],
@@ -488,79 +488,79 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase):
 
         self._check_replication([dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY,
 
         self._check_replication([dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY,
-                                expected_links=[dc3_managedBy_ou1,dc3_managedBy_ou2])
+                                expected_links=[dc3_managedBy_ou1, dc3_managedBy_ou2])
 
 
-        self._check_replication([self.ou,ou1,ou2,dc3],
+        self._check_replication([self.ou, ou1, ou2, dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY |
                                 drsuapi.DRSUAPI_DRS_GET_ANC,
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY |
                                 drsuapi.DRSUAPI_DRS_GET_ANC,
-                                expected_links=[dc3_managedBy_ou1,dc3_managedBy_ou2])
+                                expected_links=[dc3_managedBy_ou1, dc3_managedBy_ou2])
 
         # GET_TGT will also return any DNs referenced by the linked attributes
         # (including the Tombstone attribute)
         self._check_replication([ou1, ou2, dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY,
                                 more_flags=drsuapi.DRSUAPI_DRS_GET_TGT,
 
         # GET_TGT will also return any DNs referenced by the linked attributes
         # (including the Tombstone attribute)
         self._check_replication([ou1, ou2, dc3],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY,
                                 more_flags=drsuapi.DRSUAPI_DRS_GET_TGT,
-                                expected_links=[dc3_managedBy_ou1,dc3_managedBy_ou2], dn_ordered=False)
+                                expected_links=[dc3_managedBy_ou1, dc3_managedBy_ou2], dn_ordered=False)
 
         # Use the highwater-mark prior to changing ManagedBy - this should
         # only return the old/Tombstone and new linked attributes (we already
         # know all the DNs)
         self._check_replication([],
                                 drsuapi.DRSUAPI_DRS_WRIT_REP,
 
         # Use the highwater-mark prior to changing ManagedBy - this should
         # only return the old/Tombstone and new linked attributes (we already
         # know all the DNs)
         self._check_replication([],
                                 drsuapi.DRSUAPI_DRS_WRIT_REP,
-                                expected_links=[dc3_managedBy_ou1,dc3_managedBy_ou2],
+                                expected_links=[dc3_managedBy_ou1, dc3_managedBy_ou2],
                                 highwatermark=hwm7)
 
         self._check_replication([],
                                 drsuapi.DRSUAPI_DRS_WRIT_REP |
                                 drsuapi.DRSUAPI_DRS_GET_ANC,
                                 highwatermark=hwm7)
 
         self._check_replication([],
                                 drsuapi.DRSUAPI_DRS_WRIT_REP |
                                 drsuapi.DRSUAPI_DRS_GET_ANC,
-                                expected_links=[dc3_managedBy_ou1,dc3_managedBy_ou2],
+                                expected_links=[dc3_managedBy_ou1, dc3_managedBy_ou2],
                                 highwatermark=hwm7)
 
         self._check_replication([],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY,
                                 highwatermark=hwm7)
 
         self._check_replication([],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY,
-                                expected_links=[dc3_managedBy_ou1,dc3_managedBy_ou2],
+                                expected_links=[dc3_managedBy_ou1, dc3_managedBy_ou2],
                                 highwatermark=hwm7)
 
         self._check_replication([],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY |
                                 drsuapi.DRSUAPI_DRS_GET_ANC,
                                 highwatermark=hwm7)
 
         self._check_replication([],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY |
                                 drsuapi.DRSUAPI_DRS_GET_ANC,
-                                expected_links=[dc3_managedBy_ou1,dc3_managedBy_ou2],
+                                expected_links=[dc3_managedBy_ou1, dc3_managedBy_ou2],
                                 highwatermark=hwm7)
 
         self._check_replication([],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY,
                                 more_flags=drsuapi.DRSUAPI_DRS_GET_TGT,
                                 highwatermark=hwm7)
 
         self._check_replication([],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY,
                                 more_flags=drsuapi.DRSUAPI_DRS_GET_TGT,
-                                expected_links=[dc3_managedBy_ou1,dc3_managedBy_ou2],
+                                expected_links=[dc3_managedBy_ou1, dc3_managedBy_ou2],
                                 highwatermark=hwm7)
 
         # Repeat the above set of tests using the uptodateness_vector
         # instead of the highwater-mark
         self._check_replication([],
                                 drsuapi.DRSUAPI_DRS_WRIT_REP,
                                 highwatermark=hwm7)
 
         # Repeat the above set of tests using the uptodateness_vector
         # instead of the highwater-mark
         self._check_replication([],
                                 drsuapi.DRSUAPI_DRS_WRIT_REP,
-                                expected_links=[dc3_managedBy_ou1,dc3_managedBy_ou2],
+                                expected_links=[dc3_managedBy_ou1, dc3_managedBy_ou2],
                                 uptodateness_vector=utdv7)
 
         self._check_replication([],
                                 drsuapi.DRSUAPI_DRS_WRIT_REP |
                                 drsuapi.DRSUAPI_DRS_GET_ANC,
                                 uptodateness_vector=utdv7)
 
         self._check_replication([],
                                 drsuapi.DRSUAPI_DRS_WRIT_REP |
                                 drsuapi.DRSUAPI_DRS_GET_ANC,
-                                expected_links=[dc3_managedBy_ou1,dc3_managedBy_ou2],
+                                expected_links=[dc3_managedBy_ou1, dc3_managedBy_ou2],
                                 uptodateness_vector=utdv7)
 
         self._check_replication([],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY,
                                 uptodateness_vector=utdv7)
 
         self._check_replication([],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY,
-                                expected_links=[dc3_managedBy_ou1,dc3_managedBy_ou2],
+                                expected_links=[dc3_managedBy_ou1, dc3_managedBy_ou2],
                                 uptodateness_vector=utdv7)
 
         self._check_replication([],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY |
                                 drsuapi.DRSUAPI_DRS_GET_ANC,
                                 uptodateness_vector=utdv7)
 
         self._check_replication([],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY |
                                 drsuapi.DRSUAPI_DRS_GET_ANC,
-                                expected_links=[dc3_managedBy_ou1,dc3_managedBy_ou2],
+                                expected_links=[dc3_managedBy_ou1, dc3_managedBy_ou2],
                                 uptodateness_vector=utdv7)
 
         self._check_replication([],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY,
                                 more_flags=drsuapi.DRSUAPI_DRS_GET_TGT,
                                 uptodateness_vector=utdv7)
 
         self._check_replication([],
                                 drsuapi.DRSUAPI_DRS_CRITICAL_ONLY,
                                 more_flags=drsuapi.DRSUAPI_DRS_GET_TGT,
-                                expected_links=[dc3_managedBy_ou1,dc3_managedBy_ou2],
+                                expected_links=[dc3_managedBy_ou1, dc3_managedBy_ou2],
                                 uptodateness_vector=utdv7)
 
     def test_FSMONotOwner(self):
                                 uptodateness_vector=utdv7)
 
     def test_FSMONotOwner(self):
index ef1da38f82f804ee62fdde55016f8102d6d1d61b..f66938cca2f56672c837395659770a173ff23972 100644 (file)
@@ -121,7 +121,7 @@ class DrsReplSchemaTestCase(drs_base.DrsBaseTestCase):
                "cn": class_name,
                "lDAPDisplayName": class_ldn,
                "governsId": "1.3.6.1.4.1.7165.4.6.2.5." \
                "cn": class_name,
                "lDAPDisplayName": class_ldn,
                "governsId": "1.3.6.1.4.1.7165.4.6.2.5." \
-               + str((100000 * base_int) + random.randint(1,100000)) + ".1.5.13",
+               + str((100000 * base_int) + random.randint(1, 100000)) + ".1.5.13",
                "instanceType": "4",
                "objectClassCategory": "%d" % oc_cat,
                "subClassOf": "top",
                "instanceType": "4",
                "objectClassCategory": "%d" % oc_cat,
                "subClassOf": "top",
@@ -146,7 +146,7 @@ class DrsReplSchemaTestCase(drs_base.DrsBaseTestCase):
                "cn": attr_name,
                "lDAPDisplayName": attr_ldn,
                "attributeId": "1.3.6.1.4.1.7165.4.6.1.5." \
                "cn": attr_name,
                "lDAPDisplayName": attr_ldn,
                "attributeId": "1.3.6.1.4.1.7165.4.6.1.5." \
-               + str((100000 * base_int) + random.randint(1,100000)) + ".1.5.13",
+               + str((100000 * base_int) + random.randint(1, 100000)) + ".1.5.13",
                "attributeSyntax": "2.5.5.12",
                "omSyntax": "64",
                "instanceType": "4",
                "attributeSyntax": "2.5.5.12",
                "omSyntax": "64",
                "instanceType": "4",
@@ -244,7 +244,7 @@ class DrsReplSchemaTestCase(drs_base.DrsBaseTestCase):
            AttributeID_id in Schema cache"""
         # add new attributeSchema object
         (a_ldn, a_dn) = self._schema_new_attr(self.ldb_dc1, "attr-Link-X", 10,
            AttributeID_id in Schema cache"""
         # add new attributeSchema object
         (a_ldn, a_dn) = self._schema_new_attr(self.ldb_dc1, "attr-Link-X", 10,
-                                              attrs={'linkID':"1.2.840.113556.1.2.50",
+                                              attrs={'linkID': "1.2.840.113556.1.2.50",
                                                      "attributeSyntax": "2.5.5.1",
                                                      "omSyntax": "127"})
         # add a base classSchema class so we can use our new
                                                      "attributeSyntax": "2.5.5.1",
                                                      "omSyntax": "127"})
         # add a base classSchema class so we can use our new
index 258af696c72683082e2b82e994590031d4bd1033..b3b5d0835ca4ce16a92ccf0465a1782c53db2b90 100644 (file)
@@ -137,8 +137,8 @@ objectClass: organizationalUnit
         # Deleted Object base DN
         dodn = self._deleted_objects_dn(sam_ldb)
         # now check properties of the user
         # Deleted Object base DN
         dodn = self._deleted_objects_dn(sam_ldb)
         # now check properties of the user
-        name_cur  = ou_cur["ou"][0]
-        self.assertEquals(ou_cur["isDeleted"][0],"TRUE")
+        name_cur = ou_cur["ou"][0]
+        self.assertEquals(ou_cur["isDeleted"][0], "TRUE")
         self.assertTrue(not("objectCategory" in ou_cur))
         self.assertTrue(dodn in str(ou_cur["dn"]),
                         "OU %s is deleted but it is not located under %s!" % (name_cur, dodn))
         self.assertTrue(not("objectCategory" in ou_cur))
         self.assertTrue(dodn in str(ou_cur["dn"]),
                         "OU %s is deleted but it is not located under %s!" % (name_cur, dodn))
index d93c45496473422808046be6d9a20fd271066dd2..4930a3b5254a13795a8e0a2da2cbeb8e9c5420b7 100644 (file)
@@ -73,8 +73,8 @@ objectClass: organizationalUnit
         # Deleted Object base DN
         dodn = self._deleted_objects_dn(sam_ldb)
         # now check properties of the user
         # Deleted Object base DN
         dodn = self._deleted_objects_dn(sam_ldb)
         # now check properties of the user
-        name_cur  = ou_cur["ou"][0]
-        self.assertEquals(ou_cur["isDeleted"][0],"TRUE")
+        name_cur = ou_cur["ou"][0]
+        self.assertEquals(ou_cur["isDeleted"][0], "TRUE")
         self.assertTrue(not("objectCategory" in ou_cur))
         self.assertTrue(dodn in str(ou_cur["dn"]),
                         "OU %s is deleted but it is not located under %s!" % (name_cur, dodn))
         self.assertTrue(not("objectCategory" in ou_cur))
         self.assertTrue(dodn in str(ou_cur["dn"]),
                         "OU %s is deleted but it is not located under %s!" % (name_cur, dodn))
index 68713b49e395491b0ae341fd0e65fe77745b2606..cbeaec99155b3979f6f744f5f4b42fccb4335e6c 100644 (file)
@@ -292,7 +292,7 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase):
 
             (result, out, err) = self.runsubcmd("fsmo", "seize", "--role", "rid", "-H", ldb_url, "-s", smbconf, "--force")
             self.assertCmdSuccess(result, out, err)
 
             (result, out, err) = self.runsubcmd("fsmo", "seize", "--role", "rid", "-H", ldb_url, "-s", smbconf, "--force")
             self.assertCmdSuccess(result, out, err)
-            self.assertEquals(err,"","Shouldn't be any error messages")
+            self.assertEquals(err, "", "Shouldn't be any error messages")
 
             # 3. Assert we get the RID Set
             res = new_ldb.search(base=server_ref_dn,
 
             # 3. Assert we get the RID Set
             res = new_ldb.search(base=server_ref_dn,
@@ -621,7 +621,7 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase):
             # 4. Seize the RID Manager role
             (result, out, err) = self.runsubcmd("fsmo", "seize", "--role", "rid", "-H", ldb_url, "-s", smbconf, "--force")
             self.assertCmdSuccess(result, out, err)
             # 4. Seize the RID Manager role
             (result, out, err) = self.runsubcmd("fsmo", "seize", "--role", "rid", "-H", ldb_url, "-s", smbconf, "--force")
             self.assertCmdSuccess(result, out, err)
-            self.assertEquals(err,"","Shouldn't be any error messages")
+            self.assertEquals(err, "", "Shouldn't be any error messages")
 
             # 5. Add a new user (triggers RID set work)
             new_ldb.newuser("ridalloctestuser", "P@ssword!")
 
             # 5. Add a new user (triggers RID set work)
             new_ldb.newuser("ridalloctestuser", "P@ssword!")
index 1f385fc5929843c3ff75bfa5c940b8d8a977edd4..b3ef09066d8dc41085f680df0eb7dbcdc53c7f9d 100644 (file)
@@ -53,9 +53,9 @@ class wintest():
         for v in ['VM', 'HOSTNAME', 'USER', 'PASS', 'SNAPSHOT', 'REALM', 'DOMAIN', 'IP']:
             vname = '%s_%s' % (vm, v)
             if vname in self.vars:
         for v in ['VM', 'HOSTNAME', 'USER', 'PASS', 'SNAPSHOT', 'REALM', 'DOMAIN', 'IP']:
             vname = '%s_%s' % (vm, v)
             if vname in self.vars:
-                self.setvar("%s_%s" % (prefix,v), self.substitute("${%s}" % vname))
+                self.setvar("%s_%s" % (prefix, v), self.substitute("${%s}" % vname))
             else:
             else:
-                self.vars.pop("%s_%s" % (prefix,v), None)
+                self.vars.pop("%s_%s" % (prefix, v), None)
 
         if self.getvar("WIN_REALM"):
             self.setvar("WIN_REALM", self.getvar("WIN_REALM").upper())
 
         if self.getvar("WIN_REALM"):
             self.setvar("WIN_REALM", self.getvar("WIN_REALM").upper())