PEP8: fix E302: expected 2 blank lines, found 1
authorJoe Guo <joeg@catalyst.net.nz>
Mon, 30 Jul 2018 06:20:39 +0000 (18:20 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Fri, 24 Aug 2018 05:49:29 +0000 (07:49 +0200)
Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
180 files changed:
.ycm_extra_conf.py
auth/credentials/tests/bind.py
lib/ldb-samba/tests/match_rules.py
lib/ldb/tests/python/api.py
lib/talloc/test_pytalloc.py
lib/tevent/bindings.py
python/examples/samr.py
python/examples/winreg.py
python/samba/__init__.py
python/samba/descriptor.py
python/samba/dnsserver.py
python/samba/drs_utils.py
python/samba/emulate/traffic_packets.py
python/samba/gp_ext_loader.py
python/samba/gp_sec_ext.py
python/samba/gpclass.py
python/samba/graph.py
python/samba/hostconfig.py
python/samba/idmap.py
python/samba/join.py
python/samba/ms_display_specifiers.py
python/samba/ms_schema.py
python/samba/ms_schema_markdown.py
python/samba/ndr.py
python/samba/netcmd/__init__.py
python/samba/netcmd/computer.py
python/samba/netcmd/dns.py
python/samba/netcmd/domain.py
python/samba/netcmd/drs.py
python/samba/netcmd/forest.py
python/samba/netcmd/fsmo.py
python/samba/netcmd/gpo.py
python/samba/netcmd/group.py
python/samba/netcmd/ldapcmp.py
python/samba/netcmd/main.py
python/samba/netcmd/nettime.py
python/samba/netcmd/ntacl.py
python/samba/netcmd/ou.py
python/samba/netcmd/processes.py
python/samba/netcmd/rodc.py
python/samba/netcmd/schema.py
python/samba/netcmd/sites.py
python/samba/netcmd/testparm.py
python/samba/netcmd/user.py
python/samba/ntacls.py
python/samba/provision/__init__.py
python/samba/provision/kerberos.py
python/samba/provision/sambadns.py
python/samba/remove_dc.py
python/samba/samba3/__init__.py
python/samba/samdb.py
python/samba/schema.py
python/samba/subnets.py
python/samba/tdb_util.py
python/samba/tests/__init__.py
python/samba/tests/auth.py
python/samba/tests/blackbox/samba_dnsupdate.py
python/samba/tests/core.py
python/samba/tests/credentials.py
python/samba/tests/dcerpc/array.py
python/samba/tests/dcerpc/bare.py
python/samba/tests/dcerpc/dnsserver.py
python/samba/tests/dcerpc/integer.py
python/samba/tests/dcerpc/raw_protocol.py
python/samba/tests/dcerpc/raw_testcase.py
python/samba/tests/dcerpc/testrpc.py
python/samba/tests/dcerpc/unix.py
python/samba/tests/dckeytab.py
python/samba/tests/dns_forwarder.py
python/samba/tests/dns_forwarder_helpers/server.py
python/samba/tests/docs.py
python/samba/tests/dsdb.py
python/samba/tests/dsdb_lock.py
python/samba/tests/dsdb_schema_attributes.py
python/samba/tests/gensec.py
python/samba/tests/get_opt.py
python/samba/tests/gpo.py
python/samba/tests/join.py
python/samba/tests/kcc/__init__.py
python/samba/tests/krb5_credentials.py
python/samba/tests/libsmb_samba_internal.py
python/samba/tests/loadparm.py
python/samba/tests/lsa_string.py
python/samba/tests/net_join.py
python/samba/tests/net_join_no_spnego.py
python/samba/tests/netbios.py
python/samba/tests/netcmd.py
python/samba/tests/netlogonsvc.py
python/samba/tests/ntlmdisabled.py
python/samba/tests/pam_winbind.py
python/samba/tests/pam_winbind_warn_pwd_expire.py
python/samba/tests/password_hash.py
python/samba/tests/password_hash_fl2008.py
python/samba/tests/password_hash_gpgme.py
python/samba/tests/password_hash_ldap.py
python/samba/tests/password_quality.py
python/samba/tests/password_test.py
python/samba/tests/posixacl.py
python/samba/tests/provision.py
python/samba/tests/py_credentials.py
python/samba/tests/s3idmapdb.py
python/samba/tests/samba3sam.py
python/samba/tests/samba_tool/computer.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/gpo.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/ou.py
python/samba/tests/samba_tool/processes.py
python/samba/tests/samba_tool/provision_password_check.py
python/samba/tests/samba_tool/rodc.py
python/samba/tests/samba_tool/schema.py
python/samba/tests/samba_tool/timecmd.py
python/samba/tests/samba_tool/user.py
python/samba/tests/samba_tool/user_check_password_script.py
python/samba/tests/samba_tool/user_virtualCryptSHA.py
python/samba/tests/samba_tool/user_wdigest.py
python/samba/tests/smb.py
python/samba/tests/strings.py
python/samba/tests/upgradeprovision.py
python/samba/tests/upgradeprovisionneeddc.py
python/samba/tests/xattr.py
python/samba/upgrade.py
python/samba/upgradehelpers.py
python/samba/web_server/__init__.py
script/autobuild.py
script/bisect-test.py
script/generate_param.py
selftest/selftesthelpers.py
selftest/subunithelper.py
source3/build/charset.py
source3/script/tests/test_wbinfo_sids2xids_int.py
source3/selftest/tests.py
source3/torture/test_ntlm_auth.py
source4/dsdb/samdb/ldb_modules/tests/possibleinferiors.py
source4/dsdb/tests/python/acl.py
source4/dsdb/tests/python/ad_dc_medley_performance.py
source4/dsdb/tests/python/ad_dc_multi_bind.py
source4/dsdb/tests/python/ad_dc_provision_performance.py
source4/dsdb/tests/python/deletetest.py
source4/dsdb/tests/python/dirsync.py
source4/dsdb/tests/python/ldap.py
source4/dsdb/tests/python/ndr_pack_performance.py
source4/dsdb/tests/python/notification.py
source4/dsdb/tests/python/password_lockout.py
source4/dsdb/tests/python/password_lockout_base.py
source4/dsdb/tests/python/passwords.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/sites.py
source4/dsdb/tests/python/token_group.py
source4/dsdb/tests/python/tombstone_reanimation.py
source4/lib/wmi/wmi.py
source4/script/depfilter.py
source4/scripting/devel/demodirsync.py
source4/scripting/devel/pfm_verify.py
source4/scripting/devel/repl_cleartext_pwd.py
source4/scripting/devel/speedtest.py
source4/selftest/tests.py
source4/torture/drs/python/cracknames.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/getnc_unpriv.py
source4/torture/drs/python/linked_attributes_drs.py
source4/torture/drs/python/repl_move.py
source4/torture/drs/python/repl_rodc.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
source4/torture/drs/python/samba_tool_drs.py
source4/torture/libnet/python/samr-test.py
wintest/test-s3.py
wintest/test-s4-howto.py
wintest/wintest.py

index 97122a9169ef5fd30e18faa6522a67f713bdd7b7..7e47e804d5b4e24419221390cac5a0214a8616f5 100644 (file)
@@ -252,6 +252,7 @@ else:
 
 SOURCE_EXTENSIONS = [ '.C', '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ]
 
+
 def DirectoryOfThisScript():
   return os.path.dirname( os.path.abspath( __file__ ) )
 
index c397501844d165d2180cf57b666dfbbb2a1d3bff..c5f792111855add3aba422417ce3eba96b18dfa0 100755 (executable)
@@ -46,6 +46,7 @@ creds_user2 = copy.deepcopy(creds)
 creds_user3 = copy.deepcopy(creds)
 creds_user4 = copy.deepcopy(creds)
 
+
 class BindTests(samba.tests.TestCase):
 
     info_dc = None
index 6d2ba1b920d508b73427603da4455e39ee90a2fd..9088274a022c7dc5e5aa14bf8b662405105241c2 100755 (executable)
@@ -22,6 +22,8 @@ from ldb import SCOPE_BASE, SCOPE_SUBTREE, SCOPE_ONELEVEL
 #       This should be fixed to work inline with Windows.
 #       The literal strings are in the case Windows uses.
 # Windows appear to preserve casing of the RDN and uppercase the other keys.
+
+
 class MatchRulesTests(samba.tests.TestCase):
     def setUp(self):
         super(MatchRulesTests, self).setUp()
@@ -943,6 +945,7 @@ class MatchRulesTests(samba.tests.TestCase):
                                expression="memberOf:1.2.840.113556.1.4.1941:=cn=g1,%s" % self.ou_groups)
         self.assertEqual(len(res1), 0)
 
+
 class MatchRuleConditionTests(samba.tests.TestCase):
     def setUp(self):
         super(MatchRuleConditionTests, self).setUp()
index c88ddc7826ef56503b7c8126ed583c3b87dc6119..cd0320715fac3f4758dad35effe8e86d057b2b97 100755 (executable)
@@ -22,6 +22,7 @@ MDB_INDEX_OBJ = {
     "@IDX_DN_GUID": [b"GUID"]
 }
 
+
 def tempdir():
     import tempfile
     try:
@@ -685,6 +686,8 @@ class SimpleLdb(LdbBaseTest):
         self.assertRaises(ldb.LdbError, lambda: l.search("", ldb.SCOPE_SUBTREE, "&(dc=*)(dn=*)", ["dc"]))
 
 # Run the SimpleLdb tests against an lmdb backend
+
+
 class SimpleLdbLmdb(SimpleLdb):
 
     def setUp(self):
@@ -695,6 +698,7 @@ class SimpleLdbLmdb(SimpleLdb):
     def tearDown(self):
         super(SimpleLdbLmdb, self).tearDown()
 
+
 class SearchTests(LdbBaseTest):
     def tearDown(self):
         shutil.rmtree(self.testdir)
@@ -1367,6 +1371,7 @@ class IndexedSearchTests(SearchTests):
                     "@IDXATTR": [b"x", b"y", b"ou"]})
         self.IDX = True
 
+
 class IndexedCheckSearchTests(IndexedSearchTests):
     """Test searches using the index, to ensure the index doesn't
        break things (full scan disabled)"""
@@ -1375,6 +1380,7 @@ class IndexedCheckSearchTests(IndexedSearchTests):
         self.IDXCHECK = True
         super(IndexedCheckSearchTests, self).setUp()
 
+
 class IndexedSearchDnFilterTests(SearchTests):
     """Test searches using the index, to ensure the index doesn't
        break things"""
@@ -1389,6 +1395,7 @@ class IndexedSearchDnFilterTests(SearchTests):
                     "@IDXATTR": [b"x", b"y", b"ou"]})
         self.IDX = True
 
+
 class IndexedAndOneLevelSearchTests(SearchTests):
     """Test searches using the index including @IDXONE, to ensure
        the index doesn't break things"""
@@ -1401,6 +1408,7 @@ class IndexedAndOneLevelSearchTests(SearchTests):
         self.IDX = True
         self.IDXONE = True
 
+
 class IndexedCheckedAndOneLevelSearchTests(IndexedAndOneLevelSearchTests):
     """Test searches using the index including @IDXONE, to ensure
        the index doesn't break things (full scan disabled)"""
@@ -1409,6 +1417,7 @@ class IndexedCheckedAndOneLevelSearchTests(IndexedAndOneLevelSearchTests):
         self.IDXCHECK = True
         super(IndexedCheckedAndOneLevelSearchTests, self).setUp()
 
+
 class IndexedAndOneLevelDNFilterSearchTests(SearchTests):
     """Test searches using the index including @IDXONE, to ensure
        the index doesn't break things"""
@@ -1427,6 +1436,7 @@ class IndexedAndOneLevelDNFilterSearchTests(SearchTests):
         self.IDX = True
         self.IDXONE = True
 
+
 class GUIDIndexedSearchTests(SearchTests):
     """Test searches using the index, to ensure the index doesn't
        break things"""
@@ -1460,6 +1470,7 @@ class GUIDIndexedDNFilterSearchTests(SearchTests):
         self.IDX = True
         self.IDXGUID = True
 
+
 class GUIDAndOneLevelIndexedSearchTests(SearchTests):
     """Test searches using the index including @IDXONE, to ensure
        the index doesn't break things"""
@@ -1479,6 +1490,7 @@ class GUIDAndOneLevelIndexedSearchTests(SearchTests):
         self.IDXGUID = True
         self.IDXONE = True
 
+
 class GUIDIndexedSearchTestsLmdb(GUIDIndexedSearchTests):
 
     def setUp(self):
@@ -1719,6 +1731,7 @@ class AddModifyTestsLmdb(AddModifyTests):
     def tearDown(self):
         super(AddModifyTestsLmdb, self).tearDown()
 
+
 class IndexedAddModifyTests(AddModifyTests):
     """Test searches using the index, to ensure the index doesn't
        break things"""
@@ -1798,6 +1811,7 @@ class IndexedAddModifyTests(AddModifyTests):
                     "x": "z", "y": "a",
                     "objectUUID": b"0123456789abcde2"})
 
+
 class GUIDIndexedAddModifyTests(IndexedAddModifyTests):
     """Test searches using the index, to ensure the index doesn't
        break things"""
@@ -1822,6 +1836,7 @@ class GUIDTransIndexedAddModifyTests(GUIDIndexedAddModifyTests):
         self.l.transaction_commit()
         super(GUIDTransIndexedAddModifyTests, self).tearDown()
 
+
 class TransIndexedAddModifyTests(IndexedAddModifyTests):
     """Test index behaviour insdie the transaction"""
 
@@ -1833,6 +1848,7 @@ class TransIndexedAddModifyTests(IndexedAddModifyTests):
         self.l.transaction_commit()
         super(TransIndexedAddModifyTests, self).tearDown()
 
+
 class GuidIndexedAddModifyTestsLmdb(GUIDIndexedAddModifyTests):
 
     def setUp(self):
@@ -1842,6 +1858,7 @@ class GuidIndexedAddModifyTestsLmdb(GUIDIndexedAddModifyTests):
     def tearDown(self):
         super(GuidIndexedAddModifyTestsLmdb, self).tearDown()
 
+
 class GuidTransIndexedAddModifyTestsLmdb(GUIDTransIndexedAddModifyTests):
 
     def setUp(self):
@@ -1851,6 +1868,7 @@ class GuidTransIndexedAddModifyTestsLmdb(GUIDTransIndexedAddModifyTests):
     def tearDown(self):
         super(GuidTransIndexedAddModifyTestsLmdb, self).tearDown()
 
+
 class BadIndexTests(LdbBaseTest):
     def setUp(self):
         super(BadIndexTests, self).setUp()
@@ -2011,6 +2029,7 @@ class GUIDBadIndexTests(BadIndexTests):
 
         super(GUIDBadIndexTests, self).setUp()
 
+
 class DnTests(TestCase):
 
     def setUp(self):
@@ -2253,6 +2272,7 @@ class DnTests(TestCase):
         dn = ldb.Dn(self.ldb, '')
         self.assertTrue(dn.is_null())
 
+
 class LdbMsgTests(TestCase):
 
     def setUp(self):
@@ -2621,6 +2641,7 @@ class ModuleTests(TestCase):
         l = ldb.Ldb(self.filename)
         self.assertEqual(["init"], ops)
 
+
 class LdbResultTests(LdbBaseTest):
 
     def setUp(self):
index 2e58d28c7e2202754812da67885bc0073c83ed25..1acb96bc136d9a0b4a3150d6143e1a464e5360ff 100644 (file)
@@ -11,6 +11,7 @@ import gc
 import talloc
 import _test_pytalloc
 
+
 def dummy_func():
     pass
 
@@ -109,6 +110,7 @@ class TallocComparisonTests(unittest.TestCase):
         self.assertFalse(obj1 >= obj2)
         self.assertFalse(obj1 > obj2)
 
+
 class TallocBaseComparisonTests(unittest.TestCase):
 
     def test_compare_same(self):
index 55aafbb64a60686989b7918f2e597ffeffcb05a8..6bea4771b9bcce332f819e238d268bcfae19b624 100644 (file)
@@ -27,6 +27,7 @@ import gc
 
 import _tevent
 
+
 class BackendListTests(TestCase):
 
     def test_backend_list(self):
index 49559e820232452c86d4637a5020ba03249ca2e1..521ea6416107e8fba9886db98022a5780228c4a7 100755 (executable)
@@ -26,9 +26,11 @@ sys.path.insert(0, "bin/python")
 
 from samba.dcerpc import samr, security
 
+
 def display_lsa_string(str):
     return str.string
 
+
 def FillUserInfo(samr, dom_handle, users, level):
     """fill a user array with user information from samrQueryUserInfo"""
     for i in range(len(users)):
@@ -39,6 +41,7 @@ def FillUserInfo(samr, dom_handle, users, level):
         users[i] = info
         samr.Close(user_handle)
 
+
 def toArray((handle, array, num_entries)):
     ret = []
     for x in range(num_entries):
@@ -51,16 +54,19 @@ def test_Connect(samr):
     print "Testing samr_Connect"
     return samr.Connect2(None, security.SEC_FLAG_MAXIMUM_ALLOWED)
 
+
 def test_LookupDomain(samr, handle, domain):
     """test the samr_LookupDomain interface"""
     print "Testing samr_LookupDomain"
     return samr.LookupDomain(handle, domain)
 
+
 def test_OpenDomain(samr, handle, sid):
     """test the samr_OpenDomain interface"""
     print "Testing samr_OpenDomain"
     return samr.OpenDomain(handle, security.SEC_FLAG_MAXIMUM_ALLOWED, sid)
 
+
 def test_EnumDomainUsers(samr, dom_handle):
     """test the samr_EnumDomainUsers interface"""
     print "Testing samr_EnumDomainUsers"
@@ -69,6 +75,7 @@ def test_EnumDomainUsers(samr, dom_handle):
     for idx, user in users:
         print "\t%s\t(%d)" % (user.string, idx)
 
+
 def test_EnumDomainGroups(samr, dom_handle):
     """test the samr_EnumDomainGroups interface"""
     print "Testing samr_EnumDomainGroups"
@@ -77,11 +84,13 @@ def test_EnumDomainGroups(samr, dom_handle):
     for idx, group in groups:
         print "\t%s\t(%d)" % (group.string, idx)
 
+
 def test_domain_ops(samr, dom_handle):
     """test domain specific ops"""
     test_EnumDomainUsers(samr, dom_handle)
     test_EnumDomainGroups(samr, dom_handle)
 
+
 def test_EnumDomains(samr, handle):
     """test the samr_EnumDomains interface"""
     print "Testing samr_EnumDomains"
index e8029bac8bba6da470deeb8cd3e226f97262949d..e419320b16f3a5e1370f779842b46a45dc007520 100755 (executable)
@@ -32,6 +32,7 @@ binding = args[0]
 print "Connecting to " + binding
 conn = winreg.winreg(binding, sambaopts.get_loadparm())
 
+
 def list_values(key):
     (num_values, max_valnamelen, max_valbufsize) = conn.QueryInfoKey(key, winreg.String())[4:8]
     for i in range(num_values):
@@ -53,6 +54,7 @@ def list_values(key):
 #            printf("\t\t0x%llx (%lld)\n", v.value, v.value)
 #        }
 
+
 def list_path(key, path):
     count = 0
     (num_subkeys, max_subkeylen, max_subkeysize) = conn.QueryInfoKey(key, winreg.String())[1:4]
index f6fb58461a7b38f0d8b5fd4f7e68b4390963ffd6..90f85851256d2f0d5f51724e333d3af85f2479dd 100644 (file)
@@ -305,6 +305,8 @@ def setup_file(template, fname, subst_vars=None):
         f.close()
 
 MAX_NETBIOS_NAME_LEN = 15
+
+
 def is_valid_netbios_char(c):
     return (c.isalnum() or c in " !#$%&'()-.@^_{}~")
 
@@ -364,9 +366,11 @@ def dn_from_dns_name(dnsdomain):
     """return a DN from a DNS name domain/forest root"""
     return "DC=" + ",DC=".join(dnsdomain.split("."))
 
+
 def current_unix_time():
     return int(time.time())
 
+
 def string_to_byte_array(string):
     blob = [0] * len(string)
 
@@ -375,6 +379,7 @@ def string_to_byte_array(string):
 
     return blob
 
+
 def arcfour_encrypt(key, data):
     from samba.crypto import arcfour_crypt_blob
     return arcfour_crypt_blob(data, key)
index 7ab2ac430f4839b8199dd498ea29909d8012645a..0998348199226bf24d00d23f2392d1cfdc933842 100644 (file)
@@ -34,6 +34,7 @@ import re
 
 # Descriptors of naming contexts and other important objects
 
+
 def sddl2binary(sddl_in, domain_sid, name_map):
     sddl = "%s" % sddl_in
 
@@ -43,12 +44,14 @@ def sddl2binary(sddl_in, domain_sid, name_map):
     sec = security.descriptor.from_sddl(sddl, domain_sid)
     return ndr_pack(sec)
 
+
 def get_empty_descriptor(domain_sid, name_map={}):
     sddl = ""
     return sddl2binary(sddl, domain_sid, name_map)
 
 # "get_schema_descriptor" is located in "schema.py"
 
+
 def get_config_descriptor(domain_sid, name_map={}):
     sddl = "O:EAG:EAD:(OA;;CR;1131f6aa-9c07-11d1-f79f-00c04fc2dcd2;;ED)" \
            "(OA;;CR;1131f6ab-9c07-11d1-f79f-00c04fc2dcd2;;ED)" \
@@ -67,6 +70,7 @@ def get_config_descriptor(domain_sid, name_map={}):
            "(OU;SA;CR;45ec5156-db7e-47bb-b53f-dbeb2d03c40f;;WD)"
     return sddl2binary(sddl, domain_sid, name_map)
 
+
 def get_config_partitions_descriptor(domain_sid, name_map={}):
     sddl = "D:" \
         "(A;;LCLORC;;;AU)" \
@@ -84,6 +88,7 @@ def get_config_partitions_descriptor(domain_sid, name_map={}):
         "(AU;CISA;WPCRCCDCWOWDSDDT;;;WD)"
     return sddl2binary(sddl, domain_sid, name_map)
 
+
 def get_config_sites_descriptor(domain_sid, name_map={}):
     sddl = "D:" \
         "(A;;RPLCLORC;;;AU)" \
@@ -98,6 +103,7 @@ def get_config_sites_descriptor(domain_sid, name_map={}):
         "(OU;CIIOSA;WP;3e10944c-c354-11d0-aff8-0000f80367c1;b7b13124-b82e-11d0-afee-0000f80367c1;WD)"
     return sddl2binary(sddl, domain_sid, name_map)
 
+
 def get_config_ntds_quotas_descriptor(domain_sid, name_map={}):
     sddl = "D:" \
         "(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;EA)" \
@@ -105,6 +111,7 @@ def get_config_ntds_quotas_descriptor(domain_sid, name_map={}):
         "(OA;;CR;4ecc03fe-ffc0-4947-b630-eb672a8a9dbc;;WD)"
     return sddl2binary(sddl, domain_sid, name_map)
 
+
 def get_config_delete_protected1_descriptor(domain_sid, name_map={}):
     sddl = "D:AI" \
         "(A;;RPLCLORC;;;AU)" \
@@ -112,6 +119,7 @@ def get_config_delete_protected1_descriptor(domain_sid, name_map={}):
         "(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)"
     return sddl2binary(sddl, domain_sid, name_map)
 
+
 def get_config_delete_protected1wd_descriptor(domain_sid, name_map={}):
     sddl = "D:AI" \
         "(A;;RPLCLORC;;;WD)" \
@@ -119,6 +127,7 @@ def get_config_delete_protected1wd_descriptor(domain_sid, name_map={}):
         "(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)"
     return sddl2binary(sddl, domain_sid, name_map)
 
+
 def get_config_delete_protected2_descriptor(domain_sid, name_map={}):
     sddl = "D:AI" \
         "(A;;RPLCLORC;;;AU)" \
@@ -126,6 +135,7 @@ def get_config_delete_protected2_descriptor(domain_sid, name_map={}):
         "(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)"
     return sddl2binary(sddl, domain_sid, name_map)
 
+
 def get_domain_descriptor(domain_sid, name_map={}):
     sddl = "O:BAG:BAD:AI(OA;CIIO;RP;4c164200-20c0-11d0-a768-00aa006e0529;4828cc14-1437-45bc-9b07-ad6f015e5f28;RU)" \
         "(OA;CIIO;RP;4c164200-20c0-11d0-a768-00aa006e0529;bf967aba-0de6-11d0-a285-00aa003049e2;RU)" \
@@ -178,6 +188,7 @@ def get_domain_descriptor(domain_sid, name_map={}):
         "(AU;SA;CR;;;DU)(AU;SA;CR;;;BA)(AU;SA;WPWOWD;;;WD)"
     return sddl2binary(sddl, domain_sid, name_map)
 
+
 def get_domain_infrastructure_descriptor(domain_sid, name_map={}):
     sddl = "D:" \
         "(A;;RPLCLORC;;;AU)" \
@@ -187,6 +198,7 @@ def get_domain_infrastructure_descriptor(domain_sid, name_map={}):
         "(AU;SA;WPCR;;;WD)"
     return sddl2binary(sddl, domain_sid, name_map)
 
+
 def get_domain_builtin_descriptor(domain_sid, name_map={}):
     sddl = "D:" \
         "(OA;CIIO;RP;4c164200-20c0-11d0-a768-00aa006e0529;4828cc14-1437-45bc-9b07-ad6f015e5f28;RU)" \
@@ -243,6 +255,7 @@ def get_domain_builtin_descriptor(domain_sid, name_map={}):
         "(AU;SA;WPWOWD;;;WD)"
     return sddl2binary(sddl, domain_sid, name_map)
 
+
 def get_domain_computers_descriptor(domain_sid, name_map={}):
     sddl = "D:" \
         "(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)" \
@@ -256,6 +269,7 @@ def get_domain_computers_descriptor(domain_sid, name_map={}):
         "S:"
     return sddl2binary(sddl, domain_sid, name_map)
 
+
 def get_domain_users_descriptor(domain_sid, name_map={}):
     sddl = "D:" \
         "(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)" \
@@ -268,6 +282,7 @@ def get_domain_users_descriptor(domain_sid, name_map={}):
         "S:"
     return sddl2binary(sddl, domain_sid, name_map)
 
+
 def get_managed_service_accounts_descriptor(domain_sid, name_map={}):
     sddl = "D:" \
         "(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)" \
@@ -279,6 +294,7 @@ def get_managed_service_accounts_descriptor(domain_sid, name_map={}):
         "S:"
     return sddl2binary(sddl, domain_sid, name_map)
 
+
 def get_domain_controllers_descriptor(domain_sid, name_map={}):
     sddl = "D:" \
         "(A;;RPLCLORC;;;AU)" \
@@ -290,6 +306,7 @@ def get_domain_controllers_descriptor(domain_sid, name_map={}):
         "(AU;CISA;WP;;;WD)"
     return sddl2binary(sddl, domain_sid, name_map)
 
+
 def get_domain_delete_protected1_descriptor(domain_sid, name_map={}):
     sddl = "D:AI" \
         "(A;;RPLCLORC;;;AU)" \
@@ -297,6 +314,7 @@ def get_domain_delete_protected1_descriptor(domain_sid, name_map={}):
         "(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)"
     return sddl2binary(sddl, domain_sid, name_map)
 
+
 def get_domain_delete_protected2_descriptor(domain_sid, name_map={}):
     sddl = "D:AI" \
         "(A;;RPLCLORC;;;AU)" \
@@ -304,6 +322,7 @@ def get_domain_delete_protected2_descriptor(domain_sid, name_map={}):
         "(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)"
     return sddl2binary(sddl, domain_sid, name_map)
 
+
 def get_dns_partition_descriptor(domain_sid, name_map={}):
     sddl = "O:SYG:BAD:AI" \
         "(OA;CIIO;RP;4c164200-20c0-11d0-a768-00aa006e0529;4828cc14-1437-45bc-9b07-ad6f015e5f28;RU)" \
@@ -358,12 +377,14 @@ def get_dns_partition_descriptor(domain_sid, name_map={}):
         "(AU;SA;CR;;;DU)(AU;SA;CR;;;BA)(AU;SA;WPWOWD;;;WD)"
     return sddl2binary(sddl, domain_sid, name_map)
 
+
 def get_dns_forest_microsoft_dns_descriptor(domain_sid, name_map={}):
     sddl = "O:SYG:SYD:AI" \
         "(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)" \
         "(A;CI;RPWPCRCCDCLCRCWOWDSDDTSW;;;ED)"
     return sddl2binary(sddl, domain_sid, name_map)
 
+
 def get_dns_domain_microsoft_dns_descriptor(domain_sid, name_map={}):
     sddl = "O:SYG:SYD:AI" \
         "(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;DA)" \
@@ -372,6 +393,7 @@ def get_dns_domain_microsoft_dns_descriptor(domain_sid, name_map={}):
         "(A;CI;RPWPCRCCDCLCRCWOWDSDDTSW;;;ED)"
     return sddl2binary(sddl, domain_sid, name_map)
 
+
 def get_paritions_crossref_subdomain_descriptor(domain_sid, name_map={}):
     sddl = "O:SubdomainAdminsG:SubdomainAdminsD:AI" \
         "(A;;RPWPCRCCLCLORCWOWDSW;;;SubdomainAdmins)" \
@@ -379,6 +401,7 @@ def get_paritions_crossref_subdomain_descriptor(domain_sid, name_map={}):
         "(A;;RPWPCRCCDCLCLORCWOWDSDDTSW;;;SY)"
     return sddl2binary(sddl, domain_sid, name_map)
 
+
 def get_wellknown_sds(samdb):
 
     # Then subcontainers
@@ -445,6 +468,7 @@ def get_wellknown_sds(samdb):
 
     return subcontainers
 
+
 def chunck_acl(acl):
     """Return separate ACE of an ACL
 
index 2b01eaf41faca51c9b7c699ef993525cbd2c1783..6d8a72919df0795eadff2b7be46e3ba403ca6dc4 100644 (file)
@@ -23,6 +23,7 @@ from samba.dcerpc import dnsserver, dnsp
 # to overcome the bug in pidl generated python bindings.
 #
 
+
 class ARecord(dnsserver.DNS_RPC_RECORD):
     def __init__(self, ip_addr, serial=1, ttl=900, rank=dnsp.DNS_RANK_ZONE,
                  node_flag=0):
index 0bc6af577472115817dde49104d3676bf59995d6..8b812e43b8698a95e4bf92563468499f76f85e07 100644 (file)
@@ -27,6 +27,7 @@ import samba, ldb
 from samba.dcerpc.drsuapi import DRSUAPI_ATTID_name
 import re
 
+
 class drsException(Exception):
     """Base element for drs errors"""
 
index bc52de06ff0673065b8d3f079ae85a22aa0d7196..aa1d9eeeb1fdd12dd989f51a72579bac657a560e 100644 (file)
@@ -39,6 +39,7 @@ import samba
 samba.ensure_third_party_module("dns", "dnspython")
 import dns.resolver
 
+
 def uint32(v):
     return ctypes.c_uint32(v).value
 
index 23fee230440c2b4a8576d36fd9f6cce811e2d7ba..ce5d4191550582f51784dba74e2475d498508897 100644 (file)
@@ -32,6 +32,7 @@ except ImportError:
     def import_file(name, location):
         return imp.load_source(name, location)
 
+
 def get_gp_ext_from_module(name, mod):
     if mod:
         for k, v in vars(mod).items():
@@ -39,6 +40,7 @@ def get_gp_ext_from_module(name, mod):
                 return v
     return None
 
+
 def get_gp_client_side_extensions(logger, smb_conf):
     user_exts = []
     machine_exts = []
index 79c6abaea224f1d8e38b8b3508fdbfc97a4e43ea..7b65b768fee679c26128bb8f581151720ba48a03 100644 (file)
@@ -18,6 +18,7 @@
 import os.path
 from samba.gpclass import gp_ext_setter, gp_inf_ext
 
+
 class inf_to_kdc_tdb(gp_ext_setter):
     def mins_to_hours(self):
         return '%d' % (int(self.val) / 60)
@@ -47,6 +48,7 @@ class inf_to_kdc_tdb(gp_ext_setter):
     def __str__(self):
         return 'Kerberos Policy'
 
+
 class inf_to_ldb(gp_ext_setter):
     '''This class takes the .inf file parameter (essentially a GPO file mapped
     to a GUID), hashmaps it to the Samba parameter, which then uses an ldb
@@ -105,6 +107,7 @@ class inf_to_ldb(gp_ext_setter):
     def __str__(self):
         return 'System Access'
 
+
 class gp_sec_ext(gp_inf_ext):
     '''This class does the following two things:
         1) Identifies the GPO if it has a certain kind of filepath,
index 0cadcd45fc7c1f1d774f6f8e0707f661e7a484ea..751d0ad4aaea8735ca0ff9a0d42b07f47b9e0288 100644 (file)
@@ -43,6 +43,7 @@ except ImportError:
         ENFORCE = 2
         UNAPPLY = 3
 
+
 class gp_log:
     ''' Log settings overwritten by gpo apply
     The gp_log is an xml file that stores a history of gpo changes (and the
@@ -255,6 +256,7 @@ class gp_log:
         ''' Write gp_log changes to disk '''
         self.gpostore.store(self.username, etree.tostring(self.gpdb, 'utf-8'))
 
+
 class GPOStorage:
     def __init__(self, log_file):
         if os.path.isfile(log_file):
@@ -292,6 +294,7 @@ class GPOStorage:
     def __del__(self):
         self.log.close()
 
+
 class gp_ext(object):
     __metaclass__ = ABCMeta
 
@@ -325,6 +328,7 @@ class gp_ext(object):
     def __str__(self):
         pass
 
+
 class gp_ext_setter():
     __metaclass__ = ABCMeta
 
@@ -351,6 +355,7 @@ class gp_ext_setter():
     def __str__(self):
         pass
 
+
 class gp_inf_ext(gp_ext):
     @abstractmethod
     def list(self, rootpath):
@@ -398,6 +403,8 @@ class gp_inf_ext(gp_ext):
         pass
 
 ''' Fetch the hostname of a writable DC '''
+
+
 def get_dc_hostname(creds, lp):
     net = Net(creds=creds, lp=lp)
     cldap_ret = net.finddc(domain=lp.get('realm'), flags=(nbt.NBT_SERVER_LDAP |
@@ -405,6 +412,8 @@ def get_dc_hostname(creds, lp):
     return cldap_ret.pdc_dns_name
 
 ''' Fetch a list of GUIDs for applicable GPOs '''
+
+
 def get_gpo_list(dc_hostname, creds, lp):
     gpos = []
     ads = gpo.ADS_STRUCT(dc_hostname, lp, creds)
@@ -441,6 +450,7 @@ def check_safe_path(path):
         return os.path.join(*dirs)
     raise OSError(path)
 
+
 def check_refresh_gpo_list(dc_hostname, lp, creds, gpos):
     conn = smb.SMB(dc_hostname, 'sysvol', lp=lp, creds=creds, sign=True)
     cache_path = lp.cache_path('gpo_cache')
@@ -449,12 +459,14 @@ def check_refresh_gpo_list(dc_hostname, lp, creds, gpos):
             continue
         cache_gpo_dir(conn, cache_path, check_safe_path(gpo.file_sys_path))
 
+
 def gpo_version(lp, path):
     # gpo.gpo_get_sysvol_gpt_version() reads the GPT.INI from a local file,
     # read from the gpo client cache.
     gpt_path = lp.cache_path(os.path.join('gpo_cache', path))
     return int(gpo.gpo_get_sysvol_gpt_version(gpt_path)[1])
 
+
 def apply_gp(lp, creds, test_ldb, logger, store, gp_extensions):
     gp_db = store.get_gplog(creds.get_username())
     dc_hostname = get_dc_hostname(creds, lp)
@@ -491,6 +503,7 @@ def apply_gp(lp, creds, test_ldb, logger, store, gp_extensions):
         store.store(guid, '%i' % version)
         store.commit()
 
+
 def unapply_log(gp_db):
     while True:
         item = gp_db.apply_log_pop()
@@ -499,6 +512,7 @@ def unapply_log(gp_db):
         else:
             break
 
+
 def unapply_gp(lp, creds, test_ldb, logger, store, gp_extensions):
     gp_db = store.get_gplog(creds.get_username())
     gp_db.state(GPOSTATE.UNAPPLY)
@@ -511,6 +525,7 @@ def unapply_gp(lp, creds, test_ldb, logger, store, gp_extensions):
             gp_db.delete(str(attr_obj), attr[0])
         gp_db.commit()
 
+
 def parse_gpext_conf(smb_conf):
     lp = LoadParm()
     if smb_conf is not None:
@@ -522,12 +537,14 @@ def parse_gpext_conf(smb_conf):
     parser.read(ext_conf)
     return lp, parser
 
+
 def atomic_write_conf(lp, parser):
     ext_conf = lp.state_path('gpext.conf')
     with NamedTemporaryFile(delete=False, dir=os.path.dirname(ext_conf)) as f:
         parser.write(f)
         os.rename(f.name, ext_conf)
 
+
 def check_guid(guid):
     # Check for valid guid with curly braces
     if guid[0] != '{' or guid[-1] != '}' or len(guid) != 38:
@@ -538,6 +555,7 @@ def check_guid(guid):
         return False
     return True
 
+
 def register_gp_extension(guid, name, path,
                           smb_conf=None, machine=True, user=True):
     # Check that the module exists
@@ -558,6 +576,7 @@ def register_gp_extension(guid, name, path,
 
     return True
 
+
 def list_gp_extensions(smb_conf=None):
     _, parser = parse_gpext_conf(smb_conf)
     results = {}
@@ -571,6 +590,7 @@ def list_gp_extensions(smb_conf=None):
         results[guid]['UserPolicy'] = not int(parser.get(guid, 'NoUserPolicy'))
     return results
 
+
 def unregister_gp_extension(guid, smb_conf=None):
     if not check_guid(guid):
         return False
index 2f3bc9c67eb6a478fac2cd28aa8743ffd52cbee3..538c9de750f8b3c9cf21c3b8dab4172e4f2265a1 100644 (file)
@@ -675,6 +675,7 @@ def transpose_dict_matrix(m):
             m2.setdefault(k2, {})[k1] = dist
     return m2
 
+
 def full_matrix(rows,
                 utf8=False,
                 colour=None,
index 07916ab7cac1bc6189b085c0f51f8517ac91eb98..970f4892b913470b563d8047494b2c361ff36559 100644 (file)
@@ -19,6 +19,7 @@
 from __future__ import absolute_import
 from .samdb import SamDB
 
+
 class Hostconfig(object):
     """Aggregate object that contains all information about the configuration
     of a Samba host."""
index 26a3beb7d56999bac1dcd262cea49fdc1bdf83a9..8abaf98cadb8a075f19a10f8d30304c01b525323 100644 (file)
@@ -23,6 +23,7 @@ __docformat__ = "restructuredText"
 import ldb
 import samba
 
+
 class IDmapDB(samba.Ldb):
     """The IDmap database."""
 
index d5efee577370160410633b9840bddbe05042225d..45e54780883fa0dbc686d83bcf05fb55fd5964b7 100644 (file)
@@ -47,6 +47,7 @@ import re
 import os
 import tempfile
 
+
 class DCJoinException(Exception):
 
     def __init__(self, msg):
@@ -1500,6 +1501,7 @@ def join_DC(logger=None, server=None, creds=None, lp=None, site=None, netbios_na
     ctx.do_join()
     logger.info("Joined domain %s (SID %s) as a DC" % (ctx.domain_name, ctx.domsid))
 
+
 def join_clone(logger=None, server=None, creds=None, lp=None,
                targetdir=None, domain=None, include_secrets=False,
                dns_backend="NONE"):
@@ -1518,6 +1520,7 @@ def join_clone(logger=None, server=None, creds=None, lp=None,
     logger.info("Cloned domain %s (SID %s)" % (ctx.domain_name, ctx.domsid))
     return ctx
 
+
 def join_subdomain(logger=None, server=None, creds=None, lp=None, site=None,
                    netbios_name=None, targetdir=None, parent_domain=None, dnsdomain=None,
                    netbios_domain=None, machinepass=None, adminpass=None, use_ntvfs=False,
index 0d7b39aaae99eefea506808a28d43c6aa4835642..0eeeb88dc87ecfd45c3ba85ed1277440e68afeea 100644 (file)
@@ -21,6 +21,7 @@ from __future__ import print_function
 
 import re
 
+
 def __read_folded_line(f, buffer):
     """Read a line from an LDIF file, unfolding it"""
     line = buffer
@@ -57,6 +58,7 @@ def __read_folded_line(f, buffer):
 # Will not match options after the attribute type.
 attr_type_re = re.compile("^([A-Za-z][A-Za-z0-9-]*):")
 
+
 def __read_raw_entries(f):
     """Read an LDIF entry, only unfolding lines"""
 
@@ -91,6 +93,7 @@ def __read_raw_entries(f):
         if l == "":
             break
 
+
 def fix_dn(dn):
     """Fix a string DN to use ${CONFIGDN}"""
 
@@ -100,6 +103,7 @@ def fix_dn(dn):
     else:
         return dn
 
+
 def __write_ldif_one(entry):
     """Write out entry as LDIF"""
     out = []
@@ -113,6 +117,7 @@ def __write_ldif_one(entry):
 
     return "\n".join(out)
 
+
 def __transform_entry(entry):
     """Perform required transformations to the Microsoft-provided LDIF"""
 
@@ -164,6 +169,7 @@ def __transform_entry(entry):
 
     return entry
 
+
 def read_ms_ldif(filename):
     """Read and transform Microsoft-provided LDIF file."""
 
index 850bdca3ae5c8da31330be2790d26582d78590ca..60bd1ead7e2e5be9c8cf7f5075edb8c60cdd757a 100644 (file)
@@ -87,6 +87,7 @@ multivalued_attrs = set(["auxiliaryclass", "maycontain", "mustcontain", "posssup
                          "systemauxiliaryclass", "systemmaycontain", "systemmustcontain",
                          "systemposssuperiors"])
 
+
 def __read_folded_line(f, buffer):
     """ reads a line from an LDIF file, unfolding it"""
     line = buffer
@@ -174,6 +175,7 @@ def fix_dn(dn):
     else:
         return dn
 
+
 def __convert_bitfield(key, value):
     """Evaluate the OR expression in 'value'"""
     assert(isinstance(value, string_types))
@@ -193,6 +195,7 @@ def __convert_bitfield(key, value):
 
     return str(o)
 
+
 def __write_ldif_one(entry):
     """Write out entry as LDIF"""
     out = []
@@ -213,6 +216,7 @@ def __write_ldif_one(entry):
 
     return "\n".join(out)
 
+
 def __transform_entry(entry, objectClass):
     """Perform transformations required to convert the LDIF-like schema
        file entries to LDIF, including Samba-specific stuff."""
@@ -286,6 +290,7 @@ def __transform_entry(entry, objectClass):
 
     return entry
 
+
 def __parse_schema_file(filename, objectClass):
     """Load and transform a schema file."""
 
index b6cb2222ca613cecba1db94acdc4166dcd761f1e..5283e24d85851d5ee5b4d690d65b86bbdecfacc5 100644 (file)
@@ -26,11 +26,13 @@ import os
 import markdown
 import xml.etree.ElementTree as ET
 
+
 def innertext(tag):
     return (tag.text or '') + \
             ''.join(innertext(e) for e in tag) + \
             (tag.tail or '')
 
+
 def read_ms_markdown(in_file, out_folder):
     """Read Github documentation-derived schema files."""
 
index 8879caf59a5d0a767d6d034c8cc01092b0d988ff..35b2414e8ae3f253aa06e00423580e0288e05239 100644 (file)
@@ -55,6 +55,7 @@ def ndr_print(object):
         raise TypeError("%r is not a NDR object" % object)
     return ndr_print()
 
+
 def ndr_pack_in(object, bigendian=False, ndr64=False):
     """Pack the input of an NDR function object.
 
index cd1a23735501f6ce1e0d9b1a814c1ec48c6cd423..6e133591155059b994aae0f65ce92062f5559dc7 100644 (file)
@@ -23,10 +23,13 @@ from ldb import LdbError
 import sys, traceback
 import textwrap
 
+
 class Option(optparse.Option):
     pass
 
 # This help formatter does text wrapping and preserves newlines
+
+
 class PlainHelpFormatter(optparse.IndentedHelpFormatter):
     def format_description(self, description=""):
         desc_width = self.width - self.current_indent
@@ -47,6 +50,7 @@ class PlainHelpFormatter(optparse.IndentedHelpFormatter):
         else:
             return ""
 
+
 class Command(object):
     """A samba-tool command."""
 
index 6212bd67eea99d1cfcc1f9fce5069640ee192f19..ed70400f9d801d4144f738400852519f3ec5b5df 100644 (file)
@@ -435,6 +435,7 @@ class cmd_computer_list(Command):
         for msg in res:
             self.outf.write("%s\n" % msg.get("samaccountname", idx=0))
 
+
 class cmd_computer_show(Command):
     """Display a computer AD object.
 
@@ -521,6 +522,7 @@ attribute.
             computer_ldif = samdb.write_ldif(msg, ldb.CHANGETYPE_NONE)
             self.outf.write(computer_ldif)
 
+
 class cmd_computer_move(Command):
     """Move a computer to an organizational unit/container."""
 
index 26c7551bc22480499eba5582e6b66a04d7919914..072faef67ca5ad6c066e341eae6d4170f3f727fb 100644 (file)
@@ -41,6 +41,7 @@ from samba.dcerpc import dnsp, dnsserver
 
 from samba.dnsserver import ARecord, AAAARecord, PTRRecord, CNameRecord, NSRecord, MXRecord, SOARecord, SRVRecord, TXTRecord
 
+
 def dns_connect(server, lp, creds):
     if server.lower() == 'localhost':
         server = '127.0.0.1'
index 889aa922eac497a40792b040fa0177922c212891..dfcbf4617e761e5503c8845fbff0594b44ecaa8f 100644 (file)
@@ -143,6 +143,7 @@ common_ntvfs_options = [
            action="store_true")
 ]
 
+
 def get_testparm_var(testparm, smbconf, varname):
     errfile = open(os.devnull, 'w')
     p = subprocess.Popen([testparm, '-s', '-l',
@@ -1276,6 +1277,7 @@ class cmd_domain_level(Command):
         else:
             raise CommandError("invalid argument: '%s' (choose from 'show', 'raise')" % subcommand)
 
+
 class cmd_domain_passwordsettings_show(Command):
     """Display current password settings for the domain."""
 
@@ -1343,6 +1345,7 @@ class cmd_domain_passwordsettings_show(Command):
         self.message("Account lockout threshold (attempts): %d" % cur_account_lockout_threshold)
         self.message("Reset account lockout after (mins): %d" % cur_reset_account_lockout_after)
 
+
 class cmd_domain_passwordsettings_set(Command):
     """Set password settings.
 
@@ -1540,6 +1543,7 @@ class cmd_domain_passwordsettings_set(Command):
         msgs.append("All changes applied successfully!")
         self.message("\n".join(msgs))
 
+
 class cmd_domain_passwordsettings(SuperCommand):
     """Manage password policy settings."""
 
@@ -1548,6 +1552,7 @@ class cmd_domain_passwordsettings(SuperCommand):
     subcommands["show"] = cmd_domain_passwordsettings_show()
     subcommands["set"] = cmd_domain_passwordsettings_set()
 
+
 class cmd_domain_classicupgrade(Command):
     """Upgrade from Samba classic (NT4-like) database to Samba AD DC database.
 
@@ -1696,10 +1701,12 @@ class cmd_domain_samba3upgrade(cmd_domain_classicupgrade):
 
     hidden = True
 
+
 class LocalDCCredentialsOptions(options.CredentialsOptions):
     def __init__(self, parser):
         options.CredentialsOptions.__init__(self, parser, special_name="local-dc")
 
+
 class DomainTrustCommand(Command):
     """List domain trusts."""
 
@@ -2086,6 +2093,7 @@ class DomainTrustCommand(Command):
                                 d.domain_sid, collision_string))
         return
 
+
 class cmd_domain_trust_list(DomainTrustCommand):
     """List domain trusts."""
 
@@ -2132,6 +2140,7 @@ class cmd_domain_trust_list(DomainTrustCommand):
                             "Name[%s]" % self.netr_DomainTrust_to_name(t)))
         return
 
+
 class cmd_domain_trust_show(DomainTrustCommand):
     """Show trusted domain details."""
 
@@ -2238,6 +2247,7 @@ class cmd_domain_trust_show(DomainTrustCommand):
 
         return
 
+
 class cmd_domain_trust_create(DomainTrustCommand):
     """Create a domain or forest trust."""
 
@@ -2785,6 +2795,7 @@ class cmd_domain_trust_create(DomainTrustCommand):
         self.outf.write("Success.\n")
         return
 
+
 class cmd_domain_trust_delete(DomainTrustCommand):
     """Delete a domain trust."""
 
@@ -2946,6 +2957,7 @@ class cmd_domain_trust_delete(DomainTrustCommand):
 
         return
 
+
 class cmd_domain_trust_validate(DomainTrustCommand):
     """Validate a domain trust."""
 
@@ -3124,6 +3136,7 @@ class cmd_domain_trust_validate(DomainTrustCommand):
 
         return
 
+
 class cmd_domain_trust_namespaces(DomainTrustCommand):
     """Manage forest trust namespaces."""
 
@@ -3869,6 +3882,7 @@ class cmd_domain_trust_namespaces(DomainTrustCommand):
                                      tln=local_tdo_info.domain_name.string)
         return
 
+
 class cmd_domain_tombstones_expunge(Command):
     """Expunge tombstones from the database.
 
@@ -3953,12 +3967,14 @@ class cmd_domain_trust(SuperCommand):
     subcommands["validate"] = cmd_domain_trust_validate()
     subcommands["namespaces"] = cmd_domain_trust_namespaces()
 
+
 class cmd_domain_tombstones(SuperCommand):
     """Domain tombstone and recycled object management."""
 
     subcommands = {}
     subcommands["expunge"] = cmd_domain_tombstones_expunge()
 
+
 class ldif_schema_update:
     """Helper class for applying LDIF schema updates"""
 
@@ -4014,6 +4030,7 @@ class ldif_schema_update:
 
         return 1
 
+
 class cmd_domain_schema_upgrade(Command):
     """Domain schema upgrading"""
 
@@ -4264,6 +4281,7 @@ class cmd_domain_schema_upgrade(Command):
         if error_encountered:
             raise CommandError('Failed to upgrade schema')
 
+
 class cmd_domain_functional_prep(Command):
     """Domain functional level preparation"""
 
@@ -4370,6 +4388,7 @@ class cmd_domain_functional_prep(Command):
         if error_encountered:
             raise CommandError('Failed to perform functional prep')
 
+
 class cmd_domain(SuperCommand):
     """Domain management."""
 
index 7f4ca3fc120f99cc1809c7df5afcf524b1e339d8..bbb85f99936ca3a819d095fc4c465c77091644bf 100644 (file)
@@ -48,6 +48,7 @@ def drsuapi_connect(ctx):
     except Exception as e:
         raise CommandError("DRS connection to %s failed" % ctx.server, e)
 
+
 def samdb_connect(ctx):
     '''make a ldap connection to the server'''
     try:
@@ -57,6 +58,7 @@ def samdb_connect(ctx):
     except Exception as e:
         raise CommandError("LDAP connection to %s failed" % ctx.server, e)
 
+
 def drs_errmsg(werr):
     '''return "was successful" or an error string'''
     (ecode, estring) = werr
@@ -86,6 +88,7 @@ def drs_parse_ntds_dn(ntds_dn):
 
 DEFAULT_SHOWREPL_FORMAT = 'classic'
 
+
 class cmd_drs_showrepl(Command):
     """Show replication status."""
 
index 2ab0abd00520fde037dcd03ad695a74f99d00a03..4a5293c0290b99ef6f5644d422ace8dd7e94f21a 100644 (file)
@@ -27,6 +27,7 @@ from samba.netcmd import (
     Option
 )
 
+
 class cmd_forest_show(Command):
     """Display forest settings.
 
@@ -74,6 +75,7 @@ class cmd_forest_show(Command):
             except KeyError:
                 self.outf.write("%s: <NO VALUE>\n" % attr)
 
+
 class cmd_forest_set(Command):
     """Modify forest settings.
 
@@ -129,6 +131,7 @@ class cmd_forest_show_directory_service(cmd_forest_show):
     objectdn = "CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration"
     attributes = ['dsheuristics']
 
+
 class cmd_forest_set_directory_service_dsheuristics(cmd_forest_set):
     """Set the value of dsheuristics on the Directory Service.
 
@@ -148,6 +151,7 @@ class cmd_forest_set_directory_service_dsheuristics(cmd_forest_set):
     objectdn = "CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration"
     attribute = 'dsheuristics'
 
+
 class cmd_forest_directory_service(SuperCommand):
     """Forest configuration partition management."""
 
@@ -155,6 +159,7 @@ class cmd_forest_directory_service(SuperCommand):
     subcommands["show"] = cmd_forest_show_directory_service()
     subcommands["dsheuristics"] = cmd_forest_set_directory_service_dsheuristics()
 
+
 class cmd_forest(SuperCommand):
     """Forest management."""
 
index 5f67b30dedb3c80bf9eccec384c61b83a61f9440..9d39dc2b29825729fecce12e7631c27ccf59ab58 100644 (file)
@@ -31,6 +31,7 @@ from samba.netcmd import (
 )
 from samba.samdb import SamDB
 
+
 def get_fsmo_roleowner(samdb, roledn, role):
     """Gets the owner of an FSMO role
 
@@ -151,6 +152,7 @@ def transfer_dns_role(outf, sambaopts, credopts, role, samdb):
         outf.write("This DC already has the '%s' FSMO role\n" % role)
         return False
 
+
 def transfer_role(outf, role, samdb):
     """Transfer standard FSMO role. """
 
@@ -213,6 +215,7 @@ def transfer_role(outf, role, samdb):
         outf.write("This DC already has the '%s' FSMO role\n" % role)
         return False
 
+
 class cmd_fsmo_seize(Command):
     """Seize the role."""
 
@@ -474,6 +477,7 @@ class cmd_fsmo_show(Command):
             except CommandError as e:
                 self.message("%s: * %s" % (long_name, e.message))
 
+
 class cmd_fsmo_transfer(Command):
     """Transfer the role."""
 
index 06b4fe508b9576a97d9961dcd099998f8a8563a0..c0394772656f534bb36aaa6713324abc95a7a23d 100644 (file)
@@ -305,6 +305,7 @@ attr_flags = smb.FILE_ATTRIBUTE_SYSTEM | \
              smb.FILE_ATTRIBUTE_ARCHIVE | \
              smb.FILE_ATTRIBUTE_HIDDEN
 
+
 def copy_directory_remote_to_local(conn, remotedir, localdir):
     if not os.path.isdir(localdir):
         os.mkdir(localdir)
index 9022699267fcf19316c41f60c4dd9120083fe41a..bbeab76a05df121ba4a2c9ec2a4ff751982ab448 100644 (file)
@@ -359,6 +359,7 @@ class cmd_group_list(Command):
             for msg in res:
                 self.outf.write("%s\n" % msg.get("samaccountname", idx=0))
 
+
 class cmd_group_list_members(Command):
     """List all members of an AD group.
 
@@ -422,6 +423,7 @@ samba-tool group listmembers \"Domain Users\" -H ldap://samba.samdom.example.com
         except Exception as e:
             raise CommandError('Failed to list members of "%s" group ' % groupname, e)
 
+
 class cmd_group_move(Command):
     """Move a group to an organizational unit/container.
 
@@ -501,6 +503,7 @@ class cmd_group_move(Command):
         self.outf.write('Moved group "%s" into "%s"\n' %
                         (groupname, full_new_parent_dn))
 
+
 class cmd_group_show(Command):
     """Display a group AD object.
 
@@ -580,6 +583,7 @@ Example3 shows how to display a users objectGUID and member attributes.
             user_ldif = samdb.write_ldif(msg, ldb.CHANGETYPE_NONE)
             self.outf.write(user_ldif)
 
+
 class cmd_group(SuperCommand):
     """Group management."""
 
index 3b0e0d536cf2b66715b989cb377c58ebbc6840b6..bcd9c63150b60b5ce6545f9a1f58103f76e9f9ba 100644 (file)
@@ -40,6 +40,7 @@ from samba.netcmd import (
 global summary
 summary = {}
 
+
 class LDAPBase(object):
 
     def __init__(self, host, creds, lp,
@@ -262,6 +263,7 @@ class LDAPBase(object):
             except KeyError:
                 pass
 
+
 class Descriptor(object):
     def __init__(self, connection, dn, outf=sys.stdout, errf=sys.stderr):
         self.outf = outf
@@ -380,6 +382,7 @@ class Descriptor(object):
                 res += 8 * " " + ace + "\n"
         return (self_aces == [] and other_aces == [], res)
 
+
 class LDAPObject(object):
     def __init__(self, connection, dn, summary, filter_list,
                  outf=sys.stdout, errf=sys.stderr):
index ae20940ab97808254a897db5e8990c70c452169f..261cb78163db2cbb74639bc63d7856bdd96c64a6 100644 (file)
@@ -21,6 +21,7 @@ from samba import getopt as options
 
 from samba.netcmd import SuperCommand
 
+
 class cache_loader(dict):
     """
     We only load subcommand tools if they are actually used.
index dcf9f6c5cdf6afca4c2f985493fb3379ad905f23..74e3e16d13b35f3bb0cf8545e65977a2e812e2a2 100644 (file)
@@ -24,6 +24,7 @@ from samba.netcmd import (
     Command,
 )
 
+
 class cmd_time(Command):
     """Retrieve the time on a server.
 
index e7f410382c46dc44f37a06c6e00cb5a2be0c2589..ab8f317014d4628cc84eaaaf2f94269bb4b50f95 100644 (file)
@@ -116,6 +116,7 @@ class cmd_dosinfo_get(Command):
         if dosinfo:
             self.outf.write(ndr_print(dosinfo))
 
+
 class cmd_ntacl_get(Command):
     """Get ACLs of a file."""
     synopsis = "%prog <file> [options]"
@@ -238,6 +239,7 @@ class cmd_ntacl_sysvolreset(Command):
                                lp.get("realm").lower(), samdb.domain_dn(),
                                lp, use_ntvfs=use_ntvfs)
 
+
 class cmd_ntacl_sysvolcheck(Command):
     """Check sysvol ACLs match defaults (including correct ACLs on GPOs)."""
     synopsis = "%prog <file> [options]"
index 9fd9d6bc3ffe2459a05fa06fed541d18dd6bc01e..0224701b69e38fb7ca980716e5232a4632d2196b 100644 (file)
@@ -30,6 +30,7 @@ from samba.samdb import SamDB
 from samba import dsdb
 from operator import attrgetter
 
+
 class cmd_rename(Command):
     """Rename an organizational unit.
 
@@ -93,6 +94,7 @@ class cmd_rename(Command):
         self.outf.write('Renamed ou "%s" to "%s"\n' % (full_old_ou_dn,
                                                        full_new_ou_dn))
 
+
 class cmd_move(Command):
     """Move an organizational unit.
 
@@ -160,6 +162,7 @@ class cmd_move(Command):
         self.outf.write('Moved ou "%s" into "%s"\n' %
                         (full_old_ou_dn, full_new_parent_dn))
 
+
 class cmd_create(Command):
     """Create an organizational unit.
 
@@ -209,6 +212,7 @@ class cmd_create(Command):
 
         self.outf.write('Created ou "%s"\n' % full_ou_dn)
 
+
 class cmd_listobjects(Command):
     """List all objects in an organizational unit.
 
@@ -278,6 +282,7 @@ class cmd_listobjects(Command):
             raise CommandError('Failed to list contents of ou "%s"' %
                                full_ou_dn, e)
 
+
 class cmd_list(Command):
     """List all organizational units.
 
@@ -322,6 +327,7 @@ class cmd_list(Command):
                 msg.dn.remove_base_components(len(domain_dn))
             self.outf.write("%s\n" % str(msg.dn))
 
+
 class cmd_delete(Command):
     """Delete an organizational unit.
 
index 174142731c12c099f6ac177c61d7b04271302366..68569857ca0416a190208770c4483fcbc44daf74 100644 (file)
@@ -32,6 +32,7 @@ import samba.getopt as options
 from samba.netcmd import Command, CommandError, Option
 from samba.messaging import Messaging
 
+
 class cmd_processes(Command):
     """List processes (to aid debugging on systems without setproctitle)."""
 
index 372c7efb81b3dba51746fe2a716d3341a8fa12ad..c36d0b67820b8dd003d1927ec552eb798f21391c 100644 (file)
@@ -25,6 +25,7 @@ from samba.dcerpc import misc, drsuapi
 from samba.drs_utils import drs_Replicate
 import sys
 
+
 class RODCException(Exception):
     def __init__(self, value):
         self.value = value
@@ -32,12 +33,15 @@ class RODCException(Exception):
     def __str__(self):
         return "%s: %s" % (self.__class__.__name__, self.value)
 
+
 class NamingError(RODCException):
     pass
 
+
 class ReplicationError(RODCException):
     pass
 
+
 class cmd_rodc_preload(Command):
     """Preload accounts for an RODC.  Multiple accounts may be requested."""
 
index aeb947ee7237fd2b2fe1da089fb0fe1c8294be84..5768169c4c375d23179c4b64410b97e5a0207d32 100644 (file)
@@ -28,6 +28,7 @@ from samba.netcmd import (
     Option
 )
 
+
 class cmd_schema_attribute_modify(Command):
     """Modify attribute settings in the schema partition.
 
@@ -128,6 +129,7 @@ class cmd_schema_attribute_modify(Command):
         samdb.set_schema_update_now()
         self.outf.write("modified %s" % attr_dn)
 
+
 class cmd_schema_attribute_show(Command):
     """Show details about an attribute from the schema.
 
@@ -203,6 +205,7 @@ class cmd_schema_attribute_show(Command):
         user_ldif = samdb.write_ldif(res[0], ldb.CHANGETYPE_NONE)
         self.outf.write(user_ldif)
 
+
 class cmd_schema_attribute_show_oc(Command):
     """Show what objectclasses MAY or MUST contain an attribute.
 
@@ -293,6 +296,7 @@ class cmd_schema_objectclass_show(Command):
             user_ldif = samdb.write_ldif(msg, ldb.CHANGETYPE_NONE)
             self.outf.write(user_ldif)
 
+
 class cmd_schema_attribute(SuperCommand):
     """Query and manage attributes in the schema partition."""
     subcommands = {}
@@ -300,11 +304,13 @@ class cmd_schema_attribute(SuperCommand):
     subcommands["show"] = cmd_schema_attribute_show()
     subcommands["show_oc"] = cmd_schema_attribute_show_oc()
 
+
 class cmd_schema_objectclass(SuperCommand):
     """Query and manage objectclasses in the schema partition."""
     subcommands = {}
     subcommands["show"] = cmd_schema_objectclass_show()
 
+
 class cmd_schema(SuperCommand):
     """Schema querying and management."""
 
index 423a0593f3bbff148fef858ed04a2a55bb220d86..b5a2508ee3ad15584f0fc66e4a7ea177814f2dcf 100644 (file)
@@ -221,6 +221,7 @@ class cmd_sites_subnet(SuperCommand):
         "set-site": cmd_sites_subnet_set_site(),
     }
 
+
 class cmd_sites(SuperCommand):
     """Sites management."""
     subcommands = {}
index e2abd8a9a25fd3761b9adcc6c5b49ef175b6ed33..bf566f38d780a97fe79bb34c67f2bd2e9d6b8be7 100644 (file)
@@ -37,6 +37,7 @@ import samba
 import samba.getopt as options
 from samba.netcmd import Command, CommandError, Option
 
+
 class cmd_testparm(Command):
     """Syntax check the configuration file."""
 
index ab00a07b8f65075cba0d25009e6fd43e19624c26..f254bae21a6d225f331453853ce2d031ea8b9781 100644 (file)
@@ -95,17 +95,20 @@ if get_random_bytes_fn is None:
     except ImportError as e:
         pass
 
+
 def check_random():
     if get_random_bytes_fn is not None:
         return None
     return "Crypto.Random or M2Crypto.Rand required"
 
+
 def get_random_bytes(num):
     random_reason = check_random()
     if random_reason is not None:
         raise ImportError(random_reason)
     return get_random_bytes_fn(num)
 
+
 def get_crypt_value(alg, utf8pw, rounds=0):
     algs = {
         "5": {"length": 43},
@@ -139,6 +142,8 @@ def get_crypt_value(alg, utf8pw, rounds=0):
 # i.e. options = "rounds=20;other=ignored;" will return 20
 # if the rounds option is not found or the value is not a number, 0 is returned
 # which indicates that the default number of rounds should be used.
+
+
 def get_rounds(options):
     if not options:
         return 0
@@ -204,6 +209,7 @@ virtual_attributes_help += "Possible supported virtual attributes: %s" % ", ".jo
 if len(disabled_virtual_attributes) != 0:
     virtual_attributes_help += "Unsupported virtual attributes: %s" % ", ".join(sorted(disabled_virtual_attributes.keys()))
 
+
 class cmd_user_create(Command):
     """Create a new user.
 
@@ -854,6 +860,7 @@ Example3 shows how an administrator would reset TestUser3 user's password to pas
                 raise CommandError("%s: %s" % (command, msg))
             self.outf.write("Changed password OK\n")
 
+
 class GetPasswordCommand(Command):
 
     def __init__(self):
@@ -1312,6 +1319,7 @@ class GetPasswordCommand(Command):
 
         return password_attrs
 
+
 class cmd_user_getpassword(GetPasswordCommand):
     """Get the password fields of a user/computer account.
 
@@ -1464,6 +1472,7 @@ samba-tool user getpassword --filter=samaccountname=TestUser3 --attributes=msDS-
         self.outf.write("%s" % ldif)
         self.outf.write("Got password OK\n")
 
+
 class cmd_user_syncpasswords(GetPasswordCommand):
     """Sync the password of user accounts.
 
@@ -2296,6 +2305,7 @@ samba-tool user syncpasswords --terminate \\
         update_pid(None)
         return
 
+
 class cmd_user_edit(Command):
     """Modify User AD object.
 
@@ -2429,6 +2439,7 @@ LDAP server using the 'nano' editor.
 
             self.outf.write("Modified User '%s' successfully\n" % username)
 
+
 class cmd_user_show(Command):
     """Display a user AD object.
 
@@ -2507,6 +2518,7 @@ Example3 shows how to display a users objectSid and memberOf attributes.
             user_ldif = samdb.write_ldif(msg, ldb.CHANGETYPE_NONE)
             self.outf.write(user_ldif)
 
+
 class cmd_user_move(Command):
     """Move a user to an organizational unit/container.
 
@@ -2586,6 +2598,7 @@ class cmd_user_move(Command):
         self.outf.write('Moved user "%s" into "%s"\n' %
                         (username, full_new_parent_dn))
 
+
 class cmd_user(SuperCommand):
     """User management."""
 
index 1fddeddc85940b91cc6cfac901bbe822c250fb33..9b592629296d46daa4b8a21e577480fca800eae5 100644 (file)
@@ -80,6 +80,7 @@ def checkset_backend(lp, backend, eadbfile):
     else:
         raise XattrBackendError("Invalid xattr backend choice %s" %backend)
 
+
 def getdosinfo(lp, file):
     try:
         attribute = samba.xattr_native.wrap_getxattr(file,
@@ -89,6 +90,7 @@ def getdosinfo(lp, file):
 
     return ndr_unpack(xattr.DOSATTRIB, attribute)
 
+
 def getntacl(lp, file, backend=None, eadbfile=None, direct_db_access=True, service=None):
     if direct_db_access:
         (backend_obj, dbname) = checkset_backend(lp, backend, eadbfile)
index 0d80200ef951643bb0eff4e29c72d678d27483c8..25d1f61e76f46fcb3516ebcd0cb837239765fdf8 100644 (file)
@@ -709,6 +709,7 @@ def guess_names(lp=None, hostname=None, domain=None, dnsdomain=None,
 
     return names
 
+
 def make_smbconf(smbconf, hostname, domain, realm, targetdir,
                  serverrole=None, eadb=False, use_ntvfs=False, lp=None,
                  global_param=None):
@@ -1061,6 +1062,7 @@ def setup_privileges(path, session_info, lp):
     privilege_ldb.erase()
     privilege_ldb.load_ldif_file_add(setup_path("provision_privilege.ldif"))
 
+
 def setup_encrypted_secrets_key(path):
     """Setup the encrypted secrets key file.
 
@@ -1582,6 +1584,7 @@ SYSVOL_ACL = "O:LAG:BAD:P(A;OICI;0x001f01ff;;;BA)(A;OICI;0x001200a9;;;SO)(A;OICI
 POLICIES_ACL = "O:LAG:BAD:P(A;OICI;0x001f01ff;;;BA)(A;OICI;0x001200a9;;;SO)(A;OICI;0x001f01ff;;;SY)(A;OICI;0x001200a9;;;AU)(A;OICI;0x001301bf;;;PA)"
 SYSVOL_SERVICE = "sysvol"
 
+
 def set_dir_acl(path, acl, lp, domsid, use_ntvfs, passdb, service=SYSVOL_SERVICE):
     setntacl(lp, path, acl, domsid, use_ntvfs=use_ntvfs, skip_invalid_chown=True, passdb=passdb, service=service)
     for root, dirs, files in os.walk(path, topdown=False):
@@ -1729,12 +1732,14 @@ def setsysvolacl(samdb, netlogon, sysvol, uid, gid, domainsid, dnsdomain,
     # Set acls on Policy folder and policies folders
     set_gpos_acl(sysvol, dnsdomain, domainsid, domaindn, samdb, lp, use_ntvfs, passdb=s4_passdb)
 
+
 def acl_type(direct_db_access):
     if direct_db_access:
         return "DB"
     else:
         return "VFS"
 
+
 def check_dir_acl(path, acl, lp, domainsid, direct_db_access):
     fsacl = getntacl(lp, path, direct_db_access=direct_db_access, service=SYSVOL_SERVICE)
     fsacl_sddl = fsacl.as_sddl(domainsid)
@@ -2053,6 +2058,7 @@ def provision_fake_ypserver(logger, samdb, domaindn, netbiosname, nisdomain,
     else:
         samdb.transaction_commit()
 
+
 def directory_create_or_exists(path, mode=0o755):
     if not os.path.exists(path):
         try:
@@ -2063,6 +2069,7 @@ def directory_create_or_exists(path, mode=0o755):
             else:
                 raise ProvisioningError("Failed to create directory %s: %s" % (path, e.strerror))
 
+
 def determine_host_ip(logger, lp, hostip=None):
     if hostip is None:
         logger.info("Looking up IPv4 addresses")
@@ -2079,6 +2086,7 @@ def determine_host_ip(logger, lp, hostip=None):
 
     return hostip
 
+
 def determine_host_ip6(logger, lp, hostip6=None):
     if hostip6 is None:
         logger.info("Looking up IPv6 addresses")
@@ -2092,6 +2100,7 @@ def determine_host_ip6(logger, lp, hostip6=None):
 
     return hostip6
 
+
 def provision(logger, session_info, smbconf=None,
               targetdir=None, samdb_fill=FILL_FULL, realm=None, rootdn=None,
               domaindn=None, schemadn=None, configdn=None, serverdn=None,
index 4ed4d57a03c784eee031f27c9c6d7e43de172840..6b8ceb28733ca21a52eaa4c48e853107ffd6ae45 100644 (file)
@@ -23,6 +23,7 @@ from samba.provision.kerberos_implementation import (
 from samba import is_heimdal_built
 import os
 
+
 def create_kdc_conf(kdcconf, realm, domain, logdir):
 
     if is_heimdal_built():
index 3afe94cb9b451ae021ad45db115cc77a8e61204b..ff38e22ce922171ed50f26ab427e3baa732dba86 100644 (file)
@@ -61,6 +61,7 @@ from samba.provision.common import (
 
 from samba.samdb import get_default_backend_store
 
+
 def get_domainguid(samdb, domaindn):
     res = samdb.search(base=domaindn, scope=ldb.SCOPE_BASE, attrs=["objectGUID"])
     domainguid = str(ndr_unpack(misc.GUID, res[0]["objectGUID"][0]))
@@ -390,6 +391,7 @@ def add_rootservers(samdb, domaindn, prefix):
         msg["dnsRecord"] = ldb.MessageElement(record, ldb.FLAG_MOD_ADD, "dnsRecord")
         samdb.add(msg)
 
+
 def add_at_record(samdb, container_dn, prefix, hostname, dnsdomain, hostip, hostip6):
 
     fqdn_hostname = "%s.%s" % (hostname, dnsdomain)
index 12fefbed0f60ac818e5446ca9a10b40315c4814b..038177f262ef5c61bcf2a21d22ef0ca509e3f489 100644 (file)
@@ -25,6 +25,7 @@ from samba.dcerpc import misc, dnsp
 from samba.dcerpc.dnsp import DNS_TYPE_NS, DNS_TYPE_A, DNS_TYPE_AAAA, \
     DNS_TYPE_CNAME, DNS_TYPE_SRV, DNS_TYPE_PTR
 
+
 class DemoteException(Exception):
     """Base element for demote errors"""
 
@@ -284,6 +285,7 @@ def offline_remove_server(samdb, logger,
     if remove_sysvol_obj:
         remove_sysvol_references(samdb, logger, dc_name)
 
+
 def offline_remove_ntds_dc(samdb,
                            logger,
                            ntds_dn,
index 283185aa823363061d27c787d47cb321c7137806..1f8c5100bcb37e6302449505ac5d3b0414871b69 100644 (file)
@@ -29,6 +29,7 @@ import tdb
 import samba.samba3.passdb
 from samba.samba3 import param as s3param
 
+
 def fetch_uint32(db, key):
     try:
         data = db[key]
@@ -134,6 +135,7 @@ IDMAP_USER_PREFIX = b"UID "
 # idmap version determines auto-conversion
 IDMAP_VERSION_V2 = 2
 
+
 class IdmapDatabase(DbDatabase):
     """Samba 3 ID map database reader."""
 
index 2e0ec579f81d8e521ed5f0bd1a6f94309055f666..4f674e344497a1525a4c6de9dafcea19da3f14e2 100644 (file)
@@ -41,6 +41,7 @@ __docformat__ = "restructuredText"
 def get_default_backend_store():
     return "tdb"
 
+
 class SamDB(samba.Ldb):
     """The SAM database."""
 
index 55cb52e0fc4b648c203e81f1ab8e1132a9af8b23..59b53faf5cdefda51b334c38c25872892d94b220 100644 (file)
@@ -32,6 +32,7 @@ from samba import dsdb
 from ldb import SCOPE_SUBTREE, SCOPE_ONELEVEL
 import os
 
+
 def get_schema_descriptor(domain_sid, name_map={}):
     sddl = "O:SAG:SAD:AI(OA;;CR;e12b56b6-0a95-11d1-adbb-00c04fd8d5cd;;SA)" \
            "(OA;;CR;1131f6aa-9c07-11d1-f79f-00c04fc2dcd2;;ED)" \
index 32865bc3bcd0630ec76e427752cee8a203089241..dfd3a610ce8aa3332b834ae08b79f5639b14d739 100644 (file)
@@ -24,6 +24,7 @@ import ldb
 from ldb import FLAG_MOD_ADD, FLAG_MOD_REPLACE, LdbError
 from sites import SiteNotFoundException
 
+
 class SubnetException(Exception):
     """Base element for Subnet errors"""
     pass
@@ -129,6 +130,7 @@ def delete_subnet(samdb, configDn, subnet_name):
 
     samdb.delete(dnsubnet)
 
+
 def rename_subnet(samdb, configDn, subnet_name, new_name):
     """Rename a subnet.
 
@@ -164,6 +166,7 @@ def rename_subnet(samdb, configDn, subnet_name, new_name):
         else:
             raise
 
+
 def set_subnet_site(samdb, configDn, subnet_name, site_name):
     """Assign a subnet to a site.
 
index 60ecee11880b8f587b542b40cc00573328c9325c..badfbd66bba429f478d9fde9a88b02b26cb23cd5 100644 (file)
@@ -22,6 +22,7 @@ import samba
 import subprocess
 import os
 
+
 def tdb_copy(file1, file2, readonly=False):
     """Copy tdb file using tdbbackup utility and rename it
     """
index bd17a870d66780dfd452e93d22f4338b61ecd92a..75f5e98ca068f14d7fcc0dbab0f776a657f1400e 100644 (file)
@@ -58,6 +58,7 @@ except ImportError:
 
 HEXDUMP_FILTER = bytearray([x if ((len(repr(chr(x))) == 3) and (x < 127)) else ord('.') for x in range(256)])
 
+
 class TestCase(unittest.TestCase):
     """A Samba test case."""
 
@@ -320,6 +321,7 @@ def env_get_var_value(var_name, allow_missing=False):
 
 cmdline_credentials = None
 
+
 class RpcInterfaceTestCase(TestCase):
     """DCE/RPC Test case."""
 
@@ -359,6 +361,7 @@ class BlackboxProcessError(Exception):
 
         return s
 
+
 class BlackboxTestCase(TestCaseInTempDir):
     """Base test case for blackbox tests."""
 
@@ -490,6 +493,7 @@ def delete_force(samdb, dn, **kwargs):
         (num, errstr) = error.args
         assert num == ldb.ERR_NO_SUCH_OBJECT, "ldb.delete() failed: %s" % errstr
 
+
 def create_test_ou(samdb, name):
     """Creates a unique OU for the test"""
 
index 5b3cedd87542b306be2a0d5f87f99c92cebe99cd..099826e0c62e68b380c4ff88a248a7572285c576 100644 (file)
@@ -24,6 +24,7 @@ the functionality, that's already done in other tests.
 from samba import auth
 import samba.tests
 
+
 class AuthSystemSessionTests(samba.tests.TestCase):
 
     def setUp(self):
@@ -57,6 +58,7 @@ class AuthSystemSessionTests(samba.tests.TestCase):
         self.assertTrue(self.system_session.security_token.is_system())
         self.assertFalse(self.system_session.security_token.is_anonymous())
 
+
 class AuthAdminSessionTests(samba.tests.TestCase):
 
     def setUp(self):
index c4f14b319dca42ec16021b2122c1a09784c7adbb..26496740bb4f59a0e017d86028855b1b4c7f8ecf 100644 (file)
@@ -25,6 +25,7 @@ from samba.samdb import SamDB
 import ldb
 import shutil, os
 
+
 class SambaDnsUpdateTests(samba.tests.BlackboxTestCase):
     """Blackbox test case for samba_dnsupdate."""
 
index 4abb05420d2d20447849d250de041ccdcb57bf12..2614e9c99622ac9729c16571a209ea3d68e9cd7e 100644 (file)
@@ -23,6 +23,7 @@ import samba
 from samba import arcfour_encrypt, string_to_byte_array
 from samba.tests import TestCase, TestCaseInTempDir
 
+
 class SubstituteVarTestCase(TestCase):
 
     def test_empty(self):
@@ -49,6 +50,7 @@ class SubstituteVarTestCase(TestCase):
         self.assertRaises(Exception, samba.check_all_substituted,
                           "Not subsituted: ${FOOBAR}")
 
+
 class ArcfourTestCase(TestCase):
 
     def test_arcfour_direct(self):
@@ -58,6 +60,7 @@ class ArcfourTestCase(TestCase):
         crypt_calculated = arcfour_encrypt(key, plain)
         self.assertEquals(crypt_expected, crypt_calculated)
 
+
 class StringToByteArrayTestCase(TestCase):
 
     def test_byte_array(self):
@@ -65,6 +68,7 @@ class StringToByteArrayTestCase(TestCase):
         calculated = string_to_byte_array('\xda\x91Z\xb0l\xd7\xb9\xcf\x99')
         self.assertEquals(expected, calculated)
 
+
 class LdbExtensionTests(TestCaseInTempDir):
 
     def test_searchone(self):
index 7c89da54ee3b065bcaf8758d19c17dbec290e89f..0b5352bf04566be0c5863536ea50866c43405f1a 100644 (file)
@@ -28,6 +28,7 @@ import binascii
 from samba.compat import PY3
 from samba.dcerpc import misc
 
+
 class CredentialsTests(samba.tests.TestCaseInTempDir):
 
     def setUp(self):
index fed03531afb91348dfc70cca5280d4a8fe4ee665..6f31546c4db99afeca494ca07e1a608f6b42e7ca 100644 (file)
@@ -23,6 +23,7 @@ from samba.ndr import ndr_unpack, ndr_pack
 import talloc
 import gc
 
+
 class ArrayTests(samba.tests.TestCase):
 
     def setUp(self):
index 00968f15f0e04b0fb3805f950473352f19821ed6..bb25546ddc78b2dc34ffd55f6611c77fadee2b5e 100644 (file)
@@ -23,6 +23,7 @@ import os
 from samba.dcerpc import ClientConnection
 import samba.tests
 
+
 class BareTestCase(samba.tests.TestCase):
 
     def test_bare(self):
index e0fff73ad787887346a48dac8b90f154c34c096f..f68c301a9440b2a413f2372b5917ea56f3b504be 100644 (file)
@@ -29,6 +29,7 @@ from samba.tests import RpcInterfaceTestCase, env_get_var_value
 from samba.netcmd.dns import ARecord, AAAARecord, PTRRecord, CNameRecord, NSRecord, MXRecord, SRVRecord, TXTRecord
 from samba import sd_utils, descriptor
 
+
 class DnsserverTests(RpcInterfaceTestCase):
 
     @classmethod
index ca5d571b7e8eea063cdb63565b97c5c4aaeda723..62d1e67a36b298bff5c01b8f32c2e5a95f41bae9 100644 (file)
@@ -20,6 +20,7 @@
 from samba.dcerpc import server_id, misc, srvsvc, samr
 import samba.tests
 
+
 class IntegerTests(samba.tests.TestCase):
 
     def test_uint32_into_hyper(self):
index f4ba1fbe33d4d7c308b44ff57a7833ba301c4ee4..3b2579fa762572323988b1da40d70e51cc669e04 100755 (executable)
@@ -36,6 +36,7 @@ from samba.tests.dcerpc.raw_testcase import RawDCERPCTest
 global_ndr_print = False
 global_hexdump = False
 
+
 class TestDCERPC_BIND(RawDCERPCTest):
 
     def setUp(self):
index 795f45cb3eb07c42cbdb122283332fd29036fe9d..589f337e8d1515b01d17cb910d1f63fdeead6047 100644 (file)
@@ -28,6 +28,7 @@ from samba.credentials import Credentials
 from samba.tests import TestCase
 from samba.ndr import ndr_pack, ndr_unpack, ndr_unpack_out
 
+
 class RawDCERPCTest(TestCase):
     """A raw DCE/RPC Test case."""
 
index 1ebe34e62471e8e56f80af48dbc32af54593df7d..1560df647c34f129a64f5b6e142a4c07f902b159 100644 (file)
@@ -26,6 +26,7 @@ import talloc
 
 talloc.enable_null_tracking()
 
+
 class RpcTests(object):
     '''test type behaviour of pidl generated python RPC code'''
 
index e8ef4da8630a286b601afd7995d2531ce50c517c..c7e938af851dae349881c475fedaa06ced034060 100644 (file)
@@ -21,6 +21,7 @@
 from samba.dcerpc import unixinfo
 from samba.tests import RpcInterfaceTestCase
 
+
 class UnixinfoTests(RpcInterfaceTestCase):
 
     def setUp(self):
index 11bc99a2d20a4eb0de8ea13c950272f222cc1d1b..239d3113dad4dea4d92fc8b34112c936415219ab 100644 (file)
@@ -22,12 +22,14 @@ import samba.dckeytab
 from samba import tests
 from samba.param import LoadParm
 
+
 def open_bytes(filename):
     if sys.version_info[0] == 3:
         return open(filename, errors='ignore')
     else:
         return open(filename, 'rb')
 
+
 class DCKeytabTests(tests.TestCase):
     def setUp(self):
         super(DCKeytabTests, self).setUp()
index 50e390a2cc65bdbc2d86591d58f7f7b40ad48ced..1539710a21381145726cd496a6abd0cae0cd79fa 100644 (file)
@@ -66,6 +66,7 @@ dns_servers = args[2:]
 
 creds.set_krb_forwardable(credentials.NO_KRB_FORWARDABLE)
 
+
 def make_txt_record(records):
     rdata_txt = dns.txt_record()
     s_list = dnsp.string_list()
index 7bd27e53b503475d28a43cae6b38bfd8a7c280e2..4d6e57d325d90f5198d621a118422bdd3b4af465 100644 (file)
@@ -29,6 +29,7 @@ import re
 
 VERBOSE = False
 
+
 def debug(msg):
     if VERBOSE:
         sys.stdout.flush()
@@ -85,6 +86,7 @@ class DnsHandler(SocketServer.BaseRequestHandler):
         t = Timer(timeout, self.really_handle, [data, socket])
         t.start()
 
+
 def main():
     global SERVER_ID
     host, port, SERVER_ID = sys.argv[1:]
index 6a0fcf11099e3a3e2f7fb0a3ff6b4902ec6d99a3..c14e3c50e06857d71207e507e99234ac41e3b7c9 100644 (file)
@@ -27,6 +27,7 @@ import re
 import subprocess
 import xml.etree.ElementTree as ET
 
+
 class TestCase(samba.tests.TestCaseInTempDir):
 
     def _format_message(self, parameters, message):
@@ -96,6 +97,7 @@ def get_documented_tuples(sourcedir, omit_no_default=True):
         yield name, default_text, context, param_type
     p.close()
 
+
 class SmbDotConfTests(TestCase):
 
     # defines the cases where the defaults may differ from the documentation
index 4110e8d209a51b1508cbe9e449ea066354443dc3..1537838ddb8fa3947015b43b8b7c927160f75444 100644 (file)
@@ -30,6 +30,7 @@ import ldb
 import samba
 import uuid
 
+
 class DsdbTests(TestCase):
 
     def setUp(self):
@@ -726,6 +727,7 @@ class DsdbTests(TestCase):
                                 str(part_dn) + "," + str(domain_dn)),
                          self.samdb.normalize_dn_in_domain(part_dn))
 
+
 class DsdbFullScanTests(TestCase):
 
     def setUp(self):
index 332526ed795532c85d5a82c25cbfb9d8d31899f7..6728875b98ea6b40a281ddf37df63caccde1756e 100644 (file)
@@ -25,6 +25,7 @@ import samba
 import gc
 import time
 
+
 class DsdbLockTestCase(SamDBTestCase):
     def test_db_lock1(self):
         basedn = self.samdb.get_default_basedn()
index d5ad336b13c5be115fe629578880f9611210880f..5fd199a211f3c139064a4356667dd3c4195bb541 100644 (file)
@@ -33,6 +33,7 @@ from ldb import SCOPE_BASE, LdbError
 
 import samba.tests
 
+
 class SchemaAttributesTestCase(samba.tests.TestCase):
 
     def setUp(self):
index 9cb6eea93aba9236bb535142183e43f633ea6f93..7375f1dfab04ccac6dabb541b8e5283dce0b55fc 100644 (file)
@@ -25,6 +25,7 @@ from samba.credentials import Credentials
 from samba import gensec, auth
 import samba.tests
 
+
 class GensecTests(samba.tests.TestCase):
 
     def setUp(self):
index ca55c8d08b1b05ee29b210c49a19a9f642c5c438..e51c7068aba0846421e1010b8fac98764724d8c0 100644 (file)
@@ -28,6 +28,7 @@ from samba.getopt import (
 )
 import samba.tests
 
+
 class KerberosOptionTests(samba.tests.TestCase):
 
     def test_parse_true(self):
index ed5f8702b99545ee1fe4ef12194711459e7f9ebc..7c884f70c2f0c745d82342e4735dfe86fcc0e243 100644 (file)
@@ -26,6 +26,7 @@ poldir = r'\\addom.samba.example.com\sysvol\addom.samba.example.com\Policies'
 dspath = 'CN=Policies,CN=System,DC=addom,DC=samba,DC=example,DC=com'
 gpt_data = '[General]\nVersion=%d'
 
+
 class GPOTests(tests.TestCase):
     def setUp(self):
         super(GPOTests, self).setUp()
index 31b89213e451032c450a2f6b8db75d6f4af7d18c..e2432d22f9a59b685958b5c3bb92f676147709dc 100644 (file)
@@ -25,6 +25,7 @@ from samba.join import DCJoinContext
 from samba.dcerpc import drsuapi, misc, dns
 from samba.credentials import Credentials
 
+
 def get_logger(name="subunit"):
     """Get a logger object."""
     import logging
@@ -32,6 +33,7 @@ def get_logger(name="subunit"):
     logger.addHandler(logging.StreamHandler(sys.stderr))
     return logger
 
+
 class JoinTestCase(DNSTKeyTest):
     def setUp(self):
         self.server = samba.tests.env_get_var_value("SERVER")
index b251802280569f821926147912310a3568ed6fc5..a196eedb353a54c2695a763d143dfbfbb927a643 100644 (file)
@@ -48,6 +48,7 @@ ENV_DSAS = {
                    'CN=LOCALVAMPIREDC,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=samba,DC=example,DC=com'],
 }
 
+
 class KCCTests(samba.tests.TestCase):
     def setUp(self):
         super(KCCTests, self).setUp()
index 01694fe700953ae3213cab8f5ff72e30c5b6b1f2..85d1dbcdbaa128a3bc6796c5cc8eec21c9216f1a 100644 (file)
@@ -39,6 +39,7 @@ KDC
 
 MACHINE_NAME = "krb5credstest"
 
+
 class PyKrb5CredentialsTests(TestCase):
 
     def setUp(self):
index d883dae2fd74e3595a5044412ccc152cbb57fa49..ec277230d817aea0c5f286df53647e1f1b36d565 100644 (file)
@@ -26,6 +26,7 @@ import threading
 import sys
 import os
 
+
 class LibsmbTestCase(samba.tests.TestCase):
 
     class OpenClose(threading.Thread):
index daa0162b09f2641f9ba9933feff60ddf14c113d8..fc79e28efb6579fc330c934999b268a2d5ffc8b3 100644 (file)
@@ -22,6 +22,8 @@ import os
 # the python bindings for LoadParm objects map (by default) to a single global
 # object in the underlying C code. E.g. if we create 2 different LoadParm
 # objects in python, really they're just the same object underneath.
+
+
 class LoadParmTest(TestCaseInTempDir):
 
     def test_global_loadparm(self):
index 130f8807a21825db56d1b4724d9449f704f21d2f..b29e03bb34915102a688e225dd934c2020db42ee 100644 (file)
@@ -24,6 +24,7 @@ Tests for the C helper functions in source4/librpc/ndr/py_lsa.c
 for samba.dcerpc.lsa.String
 """
 
+
 class LsaStringTests(TestCase):
 
     def test_default_constructor(self):
index 41220280e621251a7797e5daa865c921f99ec92e..640e96d56f5056ecb2bf5b094f955aae53b2611c 100644 (file)
@@ -27,6 +27,7 @@ from samba.credentials import DONT_USE_KERBEROS
 from samba import NTSTATUSError, ntstatus
 import ctypes
 
+
 class NetJoinTests(samba.tests.TestCaseInTempDir):
 
     def setUp(self):
index e4dd078f2f65dd759bef5261da8e94886fd2f46a..6dbb9b0e983f41b5810cd5a479f9bf0f9cc82759 100644 (file)
@@ -27,6 +27,7 @@ from samba.credentials import DONT_USE_KERBEROS
 from samba import NTSTATUSError, ntstatus
 import ctypes
 
+
 class NetJoinNoSpnegoTests(samba.tests.TestCaseInTempDir):
 
     def setUp(self):
index f2882ebe2e6b90ddd99ed7de30b4be32089bdc15..82a0ef528ba51e8dd40e8ba7b2a6c24553600f2f 100644 (file)
@@ -18,6 +18,7 @@
 import samba, os, random, sys
 from samba import netbios
 
+
 class NetBiosTests(samba.tests.TestCase):
     def setUp(self):
         super(NetBiosTests, self).setUp()
index 8e2862306b290e29e9035fa448da129947cc4586..433bf3977c8ec90103beb90e8db6cce2496b3a1a 100644 (file)
@@ -23,6 +23,7 @@ from samba.netcmd.testparm import cmd_testparm
 from samba.netcmd.main import cmd_sambatool
 import samba.tests
 
+
 class NetCmdTestCase(samba.tests.TestCase):
 
     def run_netcmd(self, cmd_klass, args, retcode=0):
index 3dac66c71ccf57855bc2031019914a53c0b792c5..342e2efc849e211b5c6ad68bb5c14fc04002bed0 100644 (file)
@@ -28,6 +28,7 @@ import ctypes
 Tests whether the netlogon service is running
 """
 
+
 class NetlogonServiceTests(TestCase):
 
     def setUp(self):
index dadebb327f5ed72e591616e6a9a06b72656aafd2..6d2afe9054d828d4a59ceba02e7e456b7573f7a9 100644 (file)
@@ -31,6 +31,7 @@ from samba.dcerpc import srvsvc, samr, lsa
 Tests behaviour when NTLM is disabled
 """
 
+
 class NtlmDisabledTests(TestCase):
 
     def setUp(self):
index 0f38469da0bff249c53be41e172830ce4631384d..4ee7c8d784bc104d570330b8d68b6defe68fda6a 100644 (file)
@@ -20,6 +20,7 @@ import samba.tests
 import pypamtest
 import os
 
+
 class SimplePamTests(samba.tests.TestCase):
     def test_authenticate(self):
         domain = os.environ["DOMAIN"]
index c3b7e1dbfcab32a0c31ac42b90c88c03d09f8504..849099446dade730ef052c2f5edc945108bc16ae 100644 (file)
@@ -20,6 +20,7 @@ import samba.tests
 import pypamtest
 import os
 
+
 class PasswordExpirePamTests(samba.tests.TestCase):
     def test_auth_expire_warning(self):
         domain = os.environ["DOMAIN"]
index 485d7b1a3e25cd680708183ba452a277f87479c2..07d92e6ddf3c6ab3d9f5176aefe59d63229be4b9 100644 (file)
@@ -45,6 +45,8 @@ UPN       = "PWHash@User.Principle"
 # Get named package from the passed supplemental credentials
 #
 # returns the package and it's position within the supplemental credentials
+
+
 def get_package(sc, name):
     if sc is None:
         return None
@@ -59,6 +61,8 @@ def get_package(sc, name):
 
 # Calculate the MD5 password digest from the supplied user, realm and password
 #
+
+
 def calc_digest(user, realm, password):
 
     data = "%s:%s:%s" % (user, realm, password)
index 91064b4f11b674c5fc8a02acd75de5e93fb65a7e..fcfb60fdde35bddcd38bd0ab36303801481bb120 100644 (file)
@@ -34,6 +34,7 @@ from samba.ndr import ndr_unpack
 from samba.dcerpc import drsblobs
 import binascii
 
+
 class PassWordHashFl2008Tests(PassWordHashTests):
 
     def setUp(self):
index 6dafaa81acadfa606dbf71cb47a26d089ea5bb49..2834ab557c0ca74dbdae5dbbbb49ff49da717a1b 100644 (file)
@@ -37,6 +37,7 @@ import binascii
 from samba.tests.pso import PasswordSettings
 import samba
 
+
 class PassWordHashGpgmeTests(PassWordHashTests):
 
     def setUp(self):
index c2c0f7816281018f567d5ee4a40271e016c61d5e..bb641e0db231d86c55565107b473d55f6271c844 100644 (file)
@@ -49,9 +49,11 @@ from samba.credentials import Credentials
 import binascii
 import os
 
+
 def attid_equal(a1, a2):
     return (a1 & 0xffffffff) == (a2 & 0xffffffff)
 
+
 class PassWordHashLDAPTests(PassWordHashTests):
 
     def setUp(self):
index 890060e27964018c7f790e77746c654a6f98e7d3..bc8ced0aa150520bbd94bc68365edddb4ce3d8ef 100644 (file)
@@ -23,6 +23,7 @@
 from samba import check_password_quality
 from samba.tests import TestCase, TestCaseInTempDir
 
+
 class PasswordQualityTests(TestCase):
     def test_check_password_quality(self):
         self.assertFalse(check_password_quality(""),
index 3e78277adf6e45eb22008c3535d611da3f6c6239..730bd4d478905c01fc41ba0a72b18f51559b7e92 100644 (file)
@@ -21,6 +21,7 @@
 import samba.tests
 from samba.samdb import SamDB
 
+
 class PasswordCommon:
 
     @staticmethod
index 68dbaa63543aedb93f4d248f7c17ee9ae562ef9c..26138139056c23bd22937866572af6316aefea9f 100644 (file)
@@ -841,6 +841,7 @@ class SessionedPosixAclMappingTests(PosixAclMappingTests):
         return auth.user_session(self.samdb, lp_ctx=self.lp, dn=dn,
                                  session_info_flags=flags)
 
+
 class UnixSessionedPosixAclMappingTests(PosixAclMappingTests):
     """
     Run same test suite with session enabled.
index bd39abf99206761f17f5c603cc5614a181809b89..f51098629d8974b49a9f07c951a0c856e77d1b90 100644 (file)
@@ -30,6 +30,7 @@ from samba.provision import (
 import samba.tests
 from samba.tests import env_loadparm, TestCase
 
+
 def create_dummy_secretsdb(path, lp=None):
     """Create a dummy secrets database for use in tests.
 
@@ -73,6 +74,7 @@ class ProvisionTestCase(samba.tests.TestCaseInTempDir):
             if os.path.exists(secrets_tdb_path):
                 os.unlink(secrets_tdb_path)
 
+
 class FindNssTests(TestCase):
     """Test findnss() function."""
 
index c2091e498257bc651c584a4643a637a9ea9da098..71a3efb132f58cb42d8884c4d96d69885c18e5c3 100644 (file)
@@ -48,6 +48,7 @@ Integration tests for pycredentials
 MACHINE_NAME = "PCTM"
 USER_NAME    = "PCTU"
 
+
 class PyCredentialsTests(TestCase):
 
     def setUp(self):
@@ -357,6 +358,8 @@ class PyCredentialsTests(TestCase):
 
 #
 # Build the logon data required by NetrLogonSamLogonWithFlags
+
+
 def samlogon_logon_info(domain_name, computer_name, creds,
                         flags=CLI_CRED_NTLMv2_AUTH):
 
@@ -385,6 +388,8 @@ def samlogon_logon_info(domain_name, computer_name, creds,
 
 #
 # Build the samlogon target info.
+
+
 def samlogon_target(domain_name, computer_name):
     target_info = ntlmssp.AV_PAIR_LIST()
     target_info.count = 3
index cda4b3154bad60d55f68ec56380dd0df335626c7..63c7758c07570881977580ae9307dd8806a9b7d7 100644 (file)
@@ -27,6 +27,7 @@ for p in ["../../../../../testdata/samba3", "../../../../testdata/samba3"]:
     if os.path.exists(DATADIR):
         break
 
+
 class IdmapDbTestCase(TestCase):
 
     def setUp(self):
index 8ea6cad060f06e2f43b384f423f1a15b977cc449..10b6408ca795132a301767c3771b5dc84a8b608e 100644 (file)
@@ -41,6 +41,7 @@ def read_datafile(filename):
             break
     return open(os.path.join(datadir, filename), 'r').read()
 
+
 def ldb_debug(l, text):
     print(text)
 
index beb984c3c6972d8e1d0028fb9e43b67c940c67a3..678a023cc1ee3112e4a1e3306abec7ca58930578 100644 (file)
@@ -26,6 +26,7 @@ from samba import dsdb
 from samba.ndr import ndr_unpack, ndr_pack
 from samba.dcerpc import dnsp
 
+
 class ComputerCmdTestCase(SambaToolCmdTest):
     """Tests for samba-tool computer subcommands"""
     computers = []
index ccd7e8f2c1ede588ceebd8342f2f1538df3cd2bd..aace2d6cdefb2cfd81a4c2a29d1517fbfcb9fbc3 100644 (file)
@@ -24,6 +24,7 @@ from samba.ndr import ndr_unpack, ndr_pack
 from samba.dcerpc import dnsp
 from samba.tests.samba_tool.base import SambaToolCmdTest
 
+
 class DnsCmdTestCase(SambaToolCmdTest):
     def setUp(self):
         super(DnsCmdTestCase, self).setUp()
index 11c77e6105eb90c765e54ff174f594418b7ea11f..8817636bd63b0614c1d747664d0474f93c9bcb37 100644 (file)
@@ -19,6 +19,7 @@ import os
 import ldb
 from samba.tests.samba_tool.base import SambaToolCmdTest
 
+
 class ForestCmdTestCase(SambaToolCmdTest):
     """Tests for samba-tool dsacl subcommands"""
     samdb = None
index 51b735ebcfb49843dddc1f416825be78a612a161..ef475e89c690bce6649254c4cc73b0d20b8f130e 100644 (file)
@@ -18,6 +18,7 @@
 import os, ldb
 from samba.tests.samba_tool.base import SambaToolCmdTest
 
+
 class FsmoCmdTestCase(SambaToolCmdTest):
     """Test for samba-tool fsmo show subcommand"""
 
index 07e937a117e424496dc518d8a2bf9a05644f0b59..73aad386450a2d04d9b2d23b75e5e692c3266abd 100644 (file)
@@ -23,6 +23,7 @@ import samba
 from samba.tests.samba_tool.base import SambaToolCmdTest
 import shutil
 
+
 def has_difference(path1, path2, binary=True, xml=True, sortlines=False):
     """Use this function to determine if the GPO backup differs from another.
 
@@ -72,6 +73,7 @@ def has_difference(path1, path2, binary=True, xml=True, sortlines=False):
 
     return None
 
+
 class GpoCmdTestCase(SambaToolCmdTest):
     """Tests for samba-tool time subcommands"""
 
index 8b6fc889cf12e21c9e3ba187947d4acc4a53a5e2..28315c2bcd973eabee0b6e08652ce7540b3bb195 100644 (file)
@@ -24,6 +24,7 @@ from samba import (
         dsdb
         )
 
+
 class GroupCmdTestCase(SambaToolCmdTest):
     """Tests for samba-tool group subcommands"""
     groups = []
index bfb534cd29740a1cce3e2f14f4cc3342e15d31f3..8491f092658fb854eef20e6438fb3e319a82fc40 100644 (file)
@@ -18,6 +18,7 @@
 import os, ldb
 from samba.tests.samba_tool.base import SambaToolCmdTest
 
+
 class JoinCmdTestCase(SambaToolCmdTest):
     """Test for samba-tool fsmo show subcommand"""
 
index 91115cba01d5bf1b97e7855b279f72d2a5424d42..a5e5eff7d8877b7964019fb6a3aeed7d56b7f13f 100644 (file)
@@ -24,6 +24,7 @@ import ldb
 from samba.tests.samba_tool.base import SambaToolCmdTest
 import random
 
+
 class NtACLCmdSysvolTestCase(SambaToolCmdTest):
     """Tests for samba-tool ntacl sysvol* subcommands"""
 
@@ -69,6 +70,7 @@ class NtACLCmdSysvolTestCase(SambaToolCmdTest):
         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"""
 
index 82b90e467a2669f2be5f7f0aec9f0965286f56bd..4896e1a3a9bc70d79699a1129b7bf0cc6b2334c4 100644 (file)
@@ -23,6 +23,7 @@ import os
 import ldb
 from samba.tests.samba_tool.base import SambaToolCmdTest
 
+
 class OUCmdTestCase(SambaToolCmdTest):
     """Tests for samba-tool ou subcommands"""
     ous = []
index cff9cad1b27e639cb285696fee52cfe2063dfd3b..440779752b0d771afe7abaae8ea97edb530d87e4 100644 (file)
@@ -21,6 +21,7 @@
 import os
 from samba.tests.samba_tool.base import SambaToolCmdTest
 
+
 class ProcessCmdTestCase(SambaToolCmdTest):
     """Tests for samba-tool process subcommands"""
 
index b24e5804072e5f38f77f80756113e761909dba2b..b2a88699ab4c103e4898348c83393e574227a803 100644 (file)
@@ -19,6 +19,7 @@ from samba.tests.samba_tool.base import SambaToolCmdTest
 import os
 import shutil
 
+
 class ProvisionPasswordTestCase(SambaToolCmdTest):
     """Test for password validation in domain provision subcommand"""
 
index 2259f06aa7d70963f8934cafd913a9ab564d166d..dbeb763e364fe36496fb1a5eb25262d0398b017c 100644 (file)
@@ -24,6 +24,7 @@ from samba.tests.samba_tool.base import SambaToolCmdTest
 from samba.credentials import Credentials
 from samba.auth import system_session
 
+
 class RodcCmdTestCase(SambaToolCmdTest):
     def setUp(self):
         super(RodcCmdTestCase, self).setUp()
index ae095994e533e6849232c160adaee062b76847f6..54a103b81874c0e94a9123162cf955b8024e6cd1 100644 (file)
@@ -19,6 +19,7 @@ import os
 import ldb
 from samba.tests.samba_tool.base import SambaToolCmdTest
 
+
 class SchemaCmdTestCase(SambaToolCmdTest):
     """Tests for samba-tool dsacl subcommands"""
     samdb = None
index 68dcb06c402b39bb51dd08c65cc4d53bf6623755..1db51dc73e92500da0c1329e22e099192d20607c 100644 (file)
@@ -19,6 +19,7 @@ import os
 from time import localtime, strptime, mktime
 from samba.tests.samba_tool.base import SambaToolCmdTest
 
+
 class TimeCmdTestCase(SambaToolCmdTest):
     """Tests for samba-tool time subcommands"""
 
index 0cd283f2ad440a28f70a8cac68563a9cea600e3d..d04e835b2e8a3dd835ed71f1047eef93f522f8a6 100644 (file)
@@ -28,6 +28,7 @@ from samba import (
 from samba.ndr import ndr_unpack
 from samba.dcerpc import drsblobs
 
+
 class UserCmdTestCase(SambaToolCmdTest):
     """Tests for samba-tool user subcommands"""
     users = []
index c84c7f687a0c1b79e991b7df381c0d31fbd2c8c4..aaf791aff9ef32e6ec8e8fde476c43eb423b5966 100644 (file)
@@ -25,6 +25,7 @@ from samba import (
         dsdb
         )
 
+
 class UserCheckPwdTestCase(SambaToolCmdTest):
     """Tests for samba-tool user subcommands"""
     users = []
index f66fc0e9ccf9c90dc42357e4815a9643e17e9621..0a707628dcf6ef2b562014722dffb432bd2f092b 100644 (file)
@@ -51,6 +51,8 @@ HASH_OPTION = "password hash userPassword schemes"
 # Get the value of an attribute from the output string
 # Note: Does not correctly handle values spanning multiple lines,
 #       which is acceptable for it's usage in these tests.
+
+
 def _get_attribute(out, name):
     p = re.compile("^" + name + ":\s+(\S+)")
     for line in out.split("\n"):
@@ -59,6 +61,7 @@ def _get_attribute(out, name):
             return m.group(1)
     return ""
 
+
 class UserCmdCryptShaTestCase(SambaToolCmdTest):
     """
     Tests for samba-tool user subcommands generation of the virtualCryptSHA256
index a6f83edb631cd4c6df3543569dd4b1365fee4b7b..b1fadc35d86685154ce43de85f35a430bf2f78b0 100644 (file)
@@ -44,6 +44,8 @@ USER_PASS = ''.join(random.choice(string.ascii_uppercase +
 
 # Calculate the MD5 password digest from the supplied user, realm and password
 #
+
+
 def calc_digest(user, realm, password):
     data = "%s:%s:%s" % (user, realm, password)
     if isinstance(data, text_type):
index 59fd6ed9d41608bcdf995ba9d29aa61092b68662..559bb2558a4bf237693e58ed2e86407e1270f598 100644 (file)
@@ -28,6 +28,7 @@ binary_contents = binary_contents + "Hello cruel world of python3".encode('utf8'
 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):
     def setUp(self):
         super(SMBTests, self).setUp()
index 5f7d18c3a66e807a4bc001e2770c07342c4c068d..67c73319b04dd46270b33cf75f5314b3cf8f5a3c 100644 (file)
@@ -29,6 +29,7 @@ from unicodenames import *
 import samba.tests
 from samba import strcasecmp_m, strstr_m
 
+
 def signum(a):
     if a < 0:
         return -1
@@ -63,6 +64,7 @@ class strcasecmp_m_Tests(samba.tests.TestCase):
                                                   b.encode('utf-8'))),
                               expect)
 
+
 class strstr_m_Tests(samba.tests.TestCase):
     """strstr_m tests in simple ASCII and unicode strings"""
 
index 39739af02734cb1667c4edb022a22760e7a1a81e..12dd3ecb0ec73cfbf6d8b7aa7934af4801295c1b 100644 (file)
@@ -29,6 +29,7 @@ from ldb import SCOPE_BASE
 import samba.tests
 from samba.dcerpc import security
 
+
 def dummymessage(a=None, b=None):
     pass
 
index 73a3152ca46d9de5e8e5f67a8eed00bfd52cc8e0..c4d3604d98b97e205363aabc5b451b3912b39892 100644 (file)
@@ -42,6 +42,7 @@ def dummymessage(a=None, b=None):
 
 smb_conf_path = "%s/%s/%s" % (os.environ["SELFTEST_PREFIX"], "ad_dc_ntvfs", "etc/smb.conf")
 
+
 class UpgradeProvisionBasicLdbHelpersTestCase(TestCaseInTempDir):
     """Some simple tests for individual functions in the provisioning code.
     """
index ff34194328ef4d66ab146e5387abd04fe76e1045..c137dd58484de44058cf23834012eb208d4ff843 100644 (file)
@@ -30,6 +30,7 @@ import random
 import shutil
 import os
 
+
 class XattrTests(TestCase):
 
     def _tmpfilename(self):
index 2e17f186a95c6e9ee4126c24347c8e4202265e65..98d8761045cc8d6f946393ada2c4217cf2bd2b5f 100644 (file)
@@ -129,6 +129,7 @@ def add_posix_attrs(logger, samdb, sid, name, nisdomain, xid_type, home=None,
             'Could not add posix attrs for AD entry for sid=%s, (%s)',
             str(sid), str(e))
 
+
 def add_ad_posix_idmap_entry(samdb, sid, xid, xid_type, logger):
     """Create idmap entry
 
@@ -399,6 +400,7 @@ def import_registry(samba4_registry, samba3_regdb):
         for (value_name, (value_type, value_data)) in samba3_regdb.values(key).items():
             key_handle.set_value(value_name, value_type, value_data)
 
+
 def get_posix_attr_from_ldap_backend(logger, ldb_object, base_dn, user, attr):
     """Get posix attributes from a samba3 ldap backend
     :param ldbs: a list of ldb connection objects
index 262f664fc10c7027dc94cf5f991fd47dde81f56e..3f376072afcd46bbd399bccf52e7447653e069a6 100644 (file)
@@ -212,6 +212,7 @@ def get_paths(param, targetdir=None, smbconf=None):
     paths = provision_paths_from_lp(lp, lp.get("realm"))
     return paths
 
+
 def update_policyids(names, samdb):
     """Update policy ids that could have changed after sam update
 
@@ -454,6 +455,7 @@ def updateOEMInfo(samdb, rootdn):
                                                      "oEMInformation")
         samdb.modify(delta)
 
+
 def update_gpo(paths, samdb, names, lp, message):
     """Create missing GPO file object if needed
     """
@@ -467,6 +469,7 @@ def update_gpo(paths, samdb, names, lp, message):
     if not os.path.isdir(dir):
         create_gpo_struct(dir)
 
+
 def increment_calculated_keyversion_number(samdb, rootdn, hashDns):
     """For a given hash associating dn and a number, this function will
     update the replPropertyMetaData of each dn in the hash, so that the
@@ -499,6 +502,8 @@ def increment_calculated_keyversion_number(samdb, rootdn, hashDns):
                     samdb.set_attribute_replmetadata_version(str(e.dn),
                                                              "unicodePwd",
                                                              version, True)
+
+
 def delta_update_basesamdb(refsampath, sampath, creds, session, lp, message):
     """Update the provision container db: sam.ldb
     This function is aimed for alpha9 and newer;
@@ -564,6 +569,7 @@ def construct_existor_expr(attrs):
         expr = "%s)" %expr
     return expr
 
+
 def update_machine_account_password(samdb, secrets_ldb, names):
     """Update (change) the password of the current DC both in the SAM db and in
        secret one
@@ -606,6 +612,7 @@ def update_machine_account_password(samdb, secrets_ldb, names):
         raise ProvisioningError("Unable to find a Secure Channel"
                                 "of type SEC_CHAN_BDC")
 
+
 def update_dns_account_password(samdb, secrets_ldb, names):
     """Update (change) the password of the dns both in the SAM db and in
        secret one
@@ -645,6 +652,7 @@ def update_dns_account_password(samdb, secrets_ldb, names):
 
         secrets_ldb.modify(msg)
 
+
 def update_krbtgt_account_password(samdb):
     """Update (change) the password of the krbtgt account
 
@@ -663,6 +671,7 @@ def update_krbtgt_account_password(samdb):
 
     samdb.modify(msg)
 
+
 def search_constructed_attrs_stored(samdb, rootdn, attrs):
     """Search a given sam DB for calculated attributes that are
     still stored in the db.
@@ -697,6 +706,7 @@ def search_constructed_attrs_stored(samdb, rootdn, attrs):
 
     return hashAtt
 
+
 def findprovisionrange(samdb, basedn):
     """ Find ranges of usn grouped by invocation id and then by timestamp
         rouned at 1 minute
@@ -756,6 +766,7 @@ def findprovisionrange(samdb, basedn):
 
     return (hash_id, nb_obj)
 
+
 def print_provision_ranges(dic, limit_print, dest, samdb_path, invocationid):
     """ print the differents ranges passed as parameter
 
@@ -813,6 +824,7 @@ def print_provision_ranges(dic, limit_print, dest, samdb_path, invocationid):
         ldif = "dn: @PROVISION\nprovisionnerID: %s\n%s" % (invocationid, ldif)
         open(file, 'w').write(ldif)
 
+
 def int64range2str(value):
     """Display the int64 range stored in value as xxx-yyy
 
index 4344fccfaa7b014f4662f07e6d5ba214c61ab2dd..d4873fadc2b2b743e3eef46234d9f9e940dbdc97 100644 (file)
@@ -21,6 +21,7 @@
 
 from __future__ import print_function
 
+
 def render_placeholder(environ, start_response):
     """Send the user a simple placeholder about missing SWAT."""
     status = '200 OK'
index d3b46e69f26046f359fd2a5a106fb1a6b8fcd2cf..fb08af47ec08a1af821797df9a1fcc92b6b8e5f9 100755 (executable)
@@ -378,11 +378,13 @@ tasks = {
     'fail': [("fail", 'echo failing && /bin/false', "text/plain")]
 }
 
+
 def do_print(msg):
     print("%s" % msg)
     sys.stdout.flush()
     sys.stderr.flush()
 
+
 def run_cmd(cmd, dir=".", show=None, output=False, checkfail=True):
     if show is None:
         show = options.verbose
@@ -628,6 +630,7 @@ def daemonize(logfile):
     os.dup2(0, 1)
     os.dup2(0, 2)
 
+
 def write_pidfile(fname):
     '''write a pid file, cleanup on exit'''
     f = open(fname, mode='w')
@@ -666,6 +669,7 @@ def rebase_tree(rebase_url, rebase_branch="master"):
             (rebase_remote, rebase_branch),
             show=True, dir=test_master)
 
+
 def push_to(push_url, push_branch="master"):
     push_remote = "pushto"
     do_print("Pushing to %s" % push_url)
@@ -725,6 +729,7 @@ parser.add_option("", "--attach-logs", help="Attach logs to mails sent on succes
 parser.add_option("", "--restrict-tests", help="run as make test with this TESTS= regex",
                   default='')
 
+
 def send_email(subject, text, log_tar):
     if options.email is None:
         do_print("not sending email because the recipient is not set")
@@ -751,6 +756,7 @@ def send_email(subject, text, log_tar):
     s.set_debuglevel(1)
     s.quit()
 
+
 def email_failure(status, failed_task, failed_stage, failed_tag, errstr,
                   elapsed_time, log_base=None, add_log_tail=True):
     '''send an email to options.email about the failure'''
@@ -816,6 +822,7 @@ The last 50 lines of log messages:
                % (options.branch, platform.node(), failed_task, failed_stage),
                text, logs)
 
+
 def email_success(elapsed_time, log_base=None):
     '''send an email to options.email about a successful build'''
     user = os.getenv("USER")
index e06d783411709931e77325f760e3f45f6c915fa9..84496fe253acab963fedae767247da5a3faca0fe 100755 (executable)
@@ -41,6 +41,7 @@ def run_cmd(cmd, dir=".", show=True, output=False, checkfail=True):
     else:
         return call(cmd, shell=True, cwd=dir)
 
+
 def find_git_root():
     '''get to the top of the git repo'''
     p = os.getcwd()
@@ -72,6 +73,7 @@ f.write("%s || exit 1\n" % opts.test_command)
 f.write("exit 0\n")
 f.close()
 
+
 def cleanup():
     run_cmd("git bisect reset", dir=gitroot)
     os.unlink(f.name)
index 90f626f9df72d302346aee496522046c4bf29088..6cd9ace382c798ad55c89e566b4ac80e306192d6 100644 (file)
@@ -47,6 +47,7 @@ if options.filename is None:
 if options.output is None:
     parser.error("No output file specified")
 
+
 def iterate_all(path):
     """Iterate and yield all the parameters. 
 
@@ -116,6 +117,7 @@ param_type_dict = {
                     "ustring"      : "_STRING",
                   }
 
+
 def generate_functions(path_in, path_out):
     f = open(path_out, 'w')
     try:
@@ -160,6 +162,7 @@ mapping = {
             'ustring'      : 'char *',
           }
 
+
 def make_s3_param_proto(path_in, path_out):
     file_out = open(path_out, 'w')
     try:
@@ -256,11 +259,13 @@ def make_lib_proto(path_in, path_out):
     finally:
         file_out.close()
 
+
 def get_header(path):
     header = os.path.basename(path).upper()
     header = header.replace(".", "_").replace("\\", "_").replace("-", "_")
     return "__%s__" % header
 
+
 def make_param_defs(path_in, path_out, scope):
     file_out = open(path_out, 'w')
     try:
@@ -324,6 +329,7 @@ type_dict = {
               "ustring"      : "P_USTRING",
             }
 
+
 def make_param_table(path_in, path_out):
     file_out = open(path_out, 'w')
     try:
index 2d6e2b12053064b5a98db1035f4598899699e673..490bc64ebdae1dde6811ea1015408f85a1a77b28 100644 (file)
@@ -23,18 +23,23 @@ import os
 import subprocess
 import sys
 
+
 def srcdir():
     return os.path.normpath(os.getenv("SRCDIR", os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")))
 
+
 def source4dir():
     return os.path.normpath(os.path.join(srcdir(), "source4"))
 
+
 def source3dir():
     return os.path.normpath(os.path.join(srcdir(), "source3"))
 
+
 def bindir():
     return os.path.normpath(os.getenv("BINDIR", "./bin"))
 
+
 def binpath(name):
     return os.path.join(bindir(), name)
 
index 3ac2d963a90842a9fabd55bdc560ab11b4577739..830dd4ba63d0cdc062320fe223f02f1d601f05e4 100644 (file)
@@ -33,6 +33,7 @@ VALID_RESULTS = set(['success', 'successful', 'failure', 'fail', 'skip',
                      'testsuite-success', 'testsuite-error',
                      'uxsuccess', 'testsuite-uxsuccess'])
 
+
 class TestsuiteEnabledTestResult(unittest.TestResult):
 
     def start_testsuite(self, name):
index 1a23405448f392e0b6f8421e3c39e7cab6b69640..0f4f3194205420f93a5bd81af302ec4c17227c38 100644 (file)
@@ -2,6 +2,7 @@
 
 from Configure import conf
 
+
 @conf
 def CHECK_SAMBA3_CHARSET(conf, crossbuild=False):
     '''Check for default charsets for Samba3
index bc3710d716f41c513e179793dd75e9435c82fc1b..f0f51429273f606d3287d1de4a1e377f6498bb32 100755 (executable)
@@ -11,6 +11,7 @@ if len(sys.argv) != 3:
 wbinfo = sys.argv[1]
 netcmd = sys.argv[2]
 
+
 def flush_cache(sids=[], uids=[], gids=[]):
     for sid in sids:
         os.system(netcmd + (" cache del IDMAP/SID2XID/%s" % (sid)))
@@ -19,6 +20,7 @@ def flush_cache(sids=[], uids=[], gids=[]):
     for gids in gids:
         os.system(netcmd + (" cache del IDMAP/GID2SID/%s" % (gid)))
 
+
 def fill_cache(inids, idtype='gid'):
     for inid in inids:
         if inid is None:
@@ -70,6 +72,8 @@ for line in sids2xids.split('\n'):
 
 # Check the list produced by the sids-to-xids call with the
 # singular variant (sid-to-xid) for each sid in turn.
+
+
 def check_singular(sids, ids, idtype='gid'):
     i = 0
     for sid in sids:
@@ -86,6 +90,8 @@ def check_singular(sids, ids, idtype='gid'):
 
 # Check the list produced by the sids-to-xids call with the
 # multiple variant (sid-to-xid) for each sid in turn.
+
+
 def check_multiple(sids, idtypes):
     sids2xids = subprocess.Popen([wbinfo, '--sids-to-unix-ids=' + ','.join(sids)],
                                  stdout=subprocess.PIPE).communicate()[0].strip()
index 066d0beaf5e08588750f6edce8881e02f5fa1097..34a2f31246b55cbd523e46c88168914eb69e4073 100755 (executable)
@@ -27,6 +27,7 @@ smbtorture4_options.extend([
    '--option=torture:writetimeupdatedelay=500000',
 ])
 
+
 def plansmbtorture4testsuite(name, env, options, description=''):
     if description == '':
         modname = "samba3.%s" % (name, )
index 7d0ad8e520b3e63683fea69dabfda0683d7fa83e..055940651087d3a89a544bc34e53a5973df3323e 100755 (executable)
@@ -26,12 +26,15 @@ import os
 import sys
 from optparse import OptionParser
 
+
 class ReadChildError(Exception):
     pass
 
+
 class WriteChildError(Exception):
     pass
 
+
 def readLine(pipe):
     """readLine(pipe) -> str
     Read a line from the child's pipe, returns the string read.
@@ -48,6 +51,7 @@ def readLine(pipe):
 
     return buf[:newline]
 
+
 def writeLine(pipe, buf):
     """writeLine(pipe, buf) -> nul
     Write a line to the child's pipe.
@@ -58,6 +62,7 @@ def writeLine(pipe, buf):
         raise WriteChildError()
     os.write(pipe, "\n")
 
+
 def parseCommandLine():
     """parseCommandLine() -> (opts, ntlm_auth_path)
     Parse the command line.
index 6eb0b67cb854d187ec17c68908e9568f8f631ce8..09917f76ce88fa09b19723c9ac041efca13b02df 100755 (executable)
@@ -50,6 +50,7 @@ if (len(args) > 1):
 else:
     objectclass = None
 
+
 def uniq_list(alist):
     """return a unique list"""
     set = {}
@@ -75,6 +76,7 @@ rootDse = res[0]
 
 schema_base = rootDse["schemaNamingContext"][0]
 
+
 def possible_inferiors_search(db, oc):
     """return the possible inferiors via a search for the possibleInferiors attribute"""
     res = db.search(base=schema_base,
@@ -112,6 +114,7 @@ def supclasses(classinfo, oc):
     classinfo[oc]["SUPCLASSES"] = list
     return list
 
+
 def auxclasses(classinfo, oclist):
     list = []
     if oclist == []:
@@ -130,12 +133,14 @@ def auxclasses(classinfo, oclist):
             list.extend(list2)
     return list
 
+
 def subclasses(classinfo, oclist):
     list = []
     for oc in oclist:
         list.extend(classinfo[oc]["SUBCLASSES"])
     return list
 
+
 def posssuperiors(classinfo, oclist):
     list = []
     for oc in oclist:
@@ -156,6 +161,7 @@ def posssuperiors(classinfo, oclist):
             list.extend(list2)
     return list
 
+
 def pull_classinfo(db):
     """At startup we build a classinfo[] dictionary that holds all the information needed to construct the possible inferiors"""
     classinfo = {}
@@ -202,12 +208,14 @@ def pull_classinfo(db):
 
     return classinfo
 
+
 def is_in_list(list, c):
     for a in list:
         if c == a:
             return True
     return False
 
+
 def possible_inferiors_constructed(db, classinfo, c):
     list = []
     for oc in classinfo:
@@ -221,6 +229,7 @@ def possible_inferiors_constructed(db, classinfo, c):
     list.sort()
     return list
 
+
 def test_class(db, classinfo, oc):
     """test to see if one objectclass returns the correct possibleInferiors"""
     print("test: objectClass.%s" % oc)
@@ -238,6 +247,7 @@ def test_class(db, classinfo, oc):
     else:
         print("success: objectClass.%s" % oc)
 
+
 def get_object_classes(db):
     """return a list of all object classes"""
     list = []
index 71020efb26d4ca4950c7fbb062301febc55716f8..617aa6327966ba11e795ba40f5a39e02f5a02bd9 100755 (executable)
@@ -66,6 +66,7 @@ creds.set_gensec_features(creds.get_gensec_features() | gensec.FEATURE_SEAL)
 # Tests start here
 #
 
+
 class AclTests(samba.tests.TestCase):
 
     def setUp(self):
@@ -117,6 +118,8 @@ class AclTests(samba.tests.TestCase):
         del self.ldb_admin
 
 # tests on ldap add operations
+
+
 class AclAddTests(AclTests):
 
     def setUp(self):
@@ -270,6 +273,8 @@ class AclAddTests(AclTests):
             self.fail()
 
 # tests on ldap modify operations
+
+
 class AclModifyTests(AclTests):
 
     def setUp(self):
@@ -647,6 +652,8 @@ Member: CN=test_modify_user2,CN=Users,""" + self.base_dn
             self.fail()
 
 # enable these when we have search implemented
+
+
 class AclSearchTests(AclTests):
 
     def setUp(self):
@@ -1080,6 +1087,8 @@ class AclSearchTests(AclTests):
 
 
 # tests on ldap delete operations
+
+
 class AclDeleteTests(AclTests):
 
     def setUp(self):
@@ -1150,6 +1159,8 @@ class AclDeleteTests(AclTests):
             self.fail()
 
 # tests on ldap rename operations
+
+
 class AclRenameTests(AclTests):
 
     def setUp(self):
@@ -1698,6 +1709,7 @@ userPassword: thatsAcomplPASS1
             (num, _) = e34.args
             self.assertEquals(num, ERR_CONSTRAINT_VIOLATION)
 
+
 class AclExtendedTests(AclTests):
 
     def setUp(self):
@@ -1762,6 +1774,7 @@ class AclExtendedTests(AclTests):
         self.assertEqual(len(res), 1)
         self.assertTrue("nTSecurityDescriptor" in res[0].keys())
 
+
 class AclUndeleteTests(AclTests):
 
     def setUp(self):
@@ -1899,6 +1912,7 @@ class AclUndeleteTests(AclTests):
             (num, _) = e38.args
             self.assertEquals(num, ERR_INSUFFICIENT_ACCESS_RIGHTS)
 
+
 class AclSPNTests(AclTests):
 
     def setUp(self):
index f2a8fea60b5617701ae4c8248f2768d621e2cc04..f484cae9e0898ef1af628399a5ea8a419b3660cf 100644 (file)
@@ -87,6 +87,7 @@ class GlobalState(object):
     test_number = 0
     active_links = set()
 
+
 class UserTests(samba.tests.TestCase):
 
     def add_if_possible(self, *args, **kwargs):
index e85c0e10fd9f57324114e0c5001b1f3f7cf7c606..fbe2e6cf0d4e7dc14ceed679b542a6de06a15594 100644 (file)
@@ -60,6 +60,7 @@ host = args[0]
 lp = sambaopts.get_loadparm()
 creds = credopts.get_credentials(lp)
 
+
 class UserTests(samba.tests.TestCase):
 
     def setUp(self):
index 25aeb96d3354b38eabc50fa10555b35f1ef1dc85..748149e4b9982b61bd0a263da4776011908d97b2 100644 (file)
@@ -60,6 +60,7 @@ random.seed(1)
 class PerfTestException(Exception):
     pass
 
+
 class UserTests(samba.tests.TestCase):
 
     def setUp(self):
index 01e7a1d237837bc9ae4075392bce540483036fbc..7a5da0f24a8e69971949948b6e8c159aa1e18a31 100755 (executable)
@@ -41,6 +41,7 @@ host = args[0]
 lp = sambaopts.get_loadparm()
 creds = credopts.get_credentials(lp)
 
+
 class BaseDeleteTests(samba.tests.TestCase):
 
     def GUID_string(self, guid):
@@ -270,6 +271,7 @@ class BasicDeleteTests(BaseDeleteTests):
             (num, _) = e15.args
             self.assertEquals(num, ERR_UNWILLING_TO_PERFORM)
 
+
 class BasicTreeDeleteTests(BasicDeleteTests):
 
     def setUp(self):
index 0f49fd7e6304de6208cde39056f1e3568f3e99a5..8540c3729d936ba51562e666ae17dabc9f7d2b07 100755 (executable)
@@ -73,6 +73,7 @@ creds = credopts.get_credentials(lp)
 # Tests start here
 #
 
+
 class DirsyncBaseTests(samba.tests.TestCase):
 
     def setUp(self):
index 33dd04057214ef623dc548750ada07dfd11b4bac..315eafe6005c1a63e7d8f2459082920355457e49 100755 (executable)
@@ -73,6 +73,7 @@ host = args[0]
 lp = sambaopts.get_loadparm()
 creds = credopts.get_credentials(lp)
 
+
 class BasicTests(samba.tests.TestCase):
 
     def setUp(self):
@@ -3161,6 +3162,7 @@ nTSecurityDescriptor:: """ + desc_base64
             self.assertTrue(len(res[0]["msTSExpireDate"]) == 1)
             self.assertEquals(res[0]["msTSExpireDate"][0], v_get)
 
+
 class BaseDnTests(samba.tests.TestCase):
 
     def setUp(self):
index 27fd79a56fd50f719172fe6c3f28930039e0a65e..0ae9f825d2a624f6980a078d5dec50d02ad1965a 100644 (file)
@@ -141,6 +141,7 @@ e6-11d0-a285-00aa003049e2;ED)""".split())
 # set SCALE = 100 for normal test, or 1 for testing the test.
 SCALE = 100
 
+
 class UserTests(samba.tests.TestCase):
 
     def get_file_blob(self, filename):
index e8ff9ddf1ac46d5c817c392b20a0a8c3871a65cb..20fe7c5d8a3ff58b8ad79965a1bebbc90e32fc6d 100755 (executable)
@@ -63,6 +63,7 @@ lp = sambaopts.get_loadparm()
 creds = credopts.get_credentials(lp)
 creds.set_gensec_features(creds.get_gensec_features() | gensec.FEATURE_SEAL)
 
+
 class LDAPNotificationTest(samba.tests.TestCase):
 
     def setUp(self):
index 7feb8a5ce95ef0dc28d06517d1d3302d4bc14ab2..d60e55f635818033a35068b7ab10efb9458966ad 100755 (executable)
@@ -64,6 +64,7 @@ import password_lockout_base
 # Tests start here
 #
 
+
 class PasswordTests(password_lockout_base.BasePasswordTestCase):
     def setUp(self):
         self.host = host
index aee267958be5aa817786c8bebc78bfa0b5e86f8e..b83456505c64331b5fbadcec6535127484323927 100644 (file)
@@ -18,6 +18,7 @@ from samba.tests.password_test import PasswordTestCase
 
 import time
 
+
 class BasePasswordTestCase(PasswordTestCase):
     def _open_samr_user(self, res):
         self.assertTrue("objectSid" in res[0])
index 2ab1b77ea19117e2c719ed184c87c76bbd57a38b..0509612ff95aa23a62153a0a8320d85d0480ac94 100755 (executable)
@@ -66,6 +66,7 @@ creds.set_gensec_features(creds.get_gensec_features() | gensec.FEATURE_SEAL)
 # Tests start here
 #
 
+
 class PasswordTests(PasswordTestCase):
 
     def setUp(self):
index 0126f03195b550b61090af320ea3ad0be2ee3c83..ada68734bec0484405ce88defbb2ab2c9674bf98 100644 (file)
@@ -30,6 +30,7 @@ from samba.dcerpc import security, samr
 
 import password_lockout_base
 
+
 def passwd_encode(pw):
     return base64.b64encode(('"%s"' % pw).encode('utf-16-le')).decode('utf8')
 
@@ -113,6 +114,7 @@ def get_server_ref_from_samdb(samdb):
 
     return res[0]['serverReference'][0]
 
+
 class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase):
     counter = itertools.count(1).next
 
@@ -683,6 +685,7 @@ class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase):
                                   userAccountControl=dsdb.UF_NORMAL_ACCOUNT,
                                   msDSUserAccountControlComputed=0)
 
+
 class RodcRwdcTests(password_lockout_base.BasePasswordTestCase):
     counter = itertools.count(1).next
 
@@ -1261,6 +1264,7 @@ class RodcRwdcTests(password_lockout_base.BasePasswordTestCase):
 
         self._test_multiple_logon(self.lockout1ntlm_creds)
 
+
 def main():
     global RODC, RWDC, CREDS, LP
     parser = optparse.OptionParser(
index 77fd8f5b659ae566be8d3e3ce8cf2678bb6ec7a2..d894ada952e36622eb58f8b0e67af350e35b841d 100755 (executable)
@@ -74,6 +74,7 @@ lp = sambaopts.get_loadparm()
 creds = credopts.get_credentials(lp)
 creds.set_gensec_features(creds.get_gensec_features() | gensec.FEATURE_SEAL)
 
+
 class SamTests(samba.tests.TestCase):
 
     def setUp(self):
index a0b5ccc9412bdf2d982aad16fc3e5d5757956485..ca1c616b168d88e5cb4506f464cb1391108b3dc6 100755 (executable)
@@ -60,6 +60,7 @@ creds.set_gensec_features(creds.get_gensec_features() | gensec.FEATURE_SEAL)
 # Tests start here
 #
 
+
 class DescriptorTests(samba.tests.TestCase):
 
     def get_users_domain_dn(self, name):
@@ -165,6 +166,7 @@ showInAdvancedViewOnly: TRUE
 
     # Default descriptor tests #####################################################################
 
+
 class OwnerGroupDescriptorTests(DescriptorTests):
 
     def deleteAll(self):
@@ -1218,6 +1220,7 @@ class OwnerGroupDescriptorTests(DescriptorTests):
     ########################################################################################
     # Inheritance tests for DACL
 
+
 class DaclDescriptorTests(DescriptorTests):
 
     def deleteAll(self):
@@ -1949,6 +1952,7 @@ class SdFlagsDescriptorTests(DescriptorTests):
                                     controls=["extended_dn:1:0", "sd_flags:1:0", "search_options:1:1"])
         self.assertFalse("nTSecurityDescriptor" in res[0])
 
+
 class RightsAttributesTests(DescriptorTests):
 
     def deleteAll(self):
@@ -2060,6 +2064,7 @@ class RightsAttributesTests(DescriptorTests):
         self.assertTrue("displayName" in res[0]["allowedAttributesEffective"])
         self.assertTrue("managedBy" in res[0]["allowedAttributesEffective"])
 
+
 class SdAutoInheritTests(DescriptorTests):
     def deleteAll(self):
         delete_force(self.ldb_admin, self.sub_dn)
index 4c2bb5e9cadc8858c0ffa828186976311b03e19f..00673f356fc344da2bdd82ed37b98412a3dfb903 100755 (executable)
@@ -67,6 +67,7 @@ creds = credopts.get_credentials(lp)
 # Tests start here
 #
 
+
 class SitesBaseTests(samba.tests.TestCase):
 
     def setUp(self):
index 47ed46d7578e8c291ee0ced819180d3070224f75..7ddaf4e1db9f1f428f4f2a5163fb67eff09436f5 100755 (executable)
@@ -49,6 +49,7 @@ lp = sambaopts.get_loadparm()
 creds = credopts.get_credentials(lp)
 creds.set_gensec_features(creds.get_gensec_features() | gensec.FEATURE_SEAL)
 
+
 def closure(vSet, wSet, aSet):
     for edge in aSet:
         start, end = edge
@@ -57,6 +58,7 @@ def closure(vSet, wSet, aSet):
                 wSet.add(end)
                 closure(vSet, wSet, aSet)
 
+
 class StaticTokenTest(samba.tests.TestCase):
 
     def setUp(self):
@@ -172,6 +174,7 @@ class StaticTokenTest(samba.tests.TestCase):
             print("difference : %s" % sidset1.difference(sidset2))
             self.fail(msg="calculated groups don't match against user PAC tokenGroups")
 
+
 class DynamicTokenTest(samba.tests.TestCase):
 
     def get_creds(self, target_username, target_password):
index 39960f2d12de81b0dfcd8f894b45e08a610f7820..c82cb4cce98b5dee20b304a47eadbd6819a94b9f 100755 (executable)
@@ -554,6 +554,7 @@ class RestoreUserObjectTestCase(RestoredObjectAttributesBaseTestCase):
         self._check_metadata(obj_restore_rmd["replPropertyMetaData"],
                              self._expected_user_restore_metadata())
 
+
 class RestoreUserPwdObjectTestCase(RestoredObjectAttributesBaseTestCase):
     """Test cases for delete/reanimate user objects with password"""
 
@@ -762,6 +763,7 @@ class RestoreUserPwdObjectTestCase(RestoredObjectAttributesBaseTestCase):
         self._check_metadata(obj_restore_rmd["replPropertyMetaData"],
                              self._expected_userpw_restore_metadata())
 
+
 class RestoreGroupObjectTestCase(RestoredObjectAttributesBaseTestCase):
     """Test different scenarios for delete/reanimate group objects"""
 
index 54d806bdf7f62e349ab91da4885aba1b0c3418cc..9d1871f5288f27ace587a0ecd73b1348a7a71ad5 100644 (file)
@@ -10,6 +10,8 @@ try:
     _swig_property = property
 except NameError:
     pass  # Python < 2.2 doesn't have 'property'.
+
+
 def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
     if (name == "thisown"): return self.this.own(value)
     if (name == "this"):
@@ -23,15 +25,18 @@ def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
     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_getattr(self, class_type, name):
     if (name == "thisown"): return self.this.own()
     method = class_type.__swig_getmethods__.get(name, None)
     if method: return method(self)
     raise AttributeError(name)
 
+
 def _swig_repr(self):
     try: strthis = "proxy of " + self.this.__repr__()
     except: strthis = ""
@@ -58,6 +63,8 @@ def _swig_setattr_nondynamic_method(set):
 
 
 WBEM_ConnectServer = _wmi.WBEM_ConnectServer
+
+
 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
@@ -69,6 +76,7 @@ IUnknown.Release = new_instancemethod(_wmi.IUnknown_Release, None, IUnknown)
 IUnknown_swigregister = _wmi.IUnknown_swigregister
 IUnknown_swigregister(IUnknown)
 
+
 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
@@ -82,6 +90,7 @@ IWbemServices.CreateInstanceEnum = new_instancemethod(_wmi.IWbemServices_CreateI
 IWbemServices_swigregister = _wmi.IWbemServices_swigregister
 IWbemServices_swigregister(IWbemServices)
 
+
 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
index c74298dd8d3d912bfa6cad6eaff7c528045309fd..e4f0d0aba44152419d568f275f7f5eb627a12fa0 100755 (executable)
@@ -32,6 +32,7 @@ for arc in lines[1:-1]:
 
 subgraph = {}
 
+
 def add_deps(node):
     if node in graph and node not in subgraph:
         subgraph[node] = graph[node]
index 83263ea9f03783a1390263fb9002e59ae88181f2..8f1e7d7c45171ea5bf21f99426cc3448bae5014f 100755 (executable)
@@ -28,6 +28,7 @@ creds = credopts.get_credentials(lp)
 
 opts = parser.parse_args()[0]
 
+
 def printdirsync(ctl):
         arr = ctl.split(':')
         if arr[0] == 'dirsync':
index a8aafede2cff3a2056c126a61432cb5f08772fb6..53f61dec67a5f707b74a16d1278d088b15f25cc1 100755 (executable)
@@ -48,6 +48,7 @@ def _samdb_fetch_pfm(samdb):
 
     return (pfm.ctr, pfm_schi)
 
+
 def _samdb_fetch_schi(samdb):
     """Fetch schemaInfo stored in SamDB using LDB connection"""
     res = samdb.search(base=samdb.get_schema_basedn(), expression="", scope=SCOPE_BASE, attrs=["*"])
@@ -60,6 +61,7 @@ def _samdb_fetch_schi(samdb):
         pfm_schi.marker = 0xFF;
     return pfm_schi
 
+
 def _drs_fetch_pfm(server, samdb, creds, lp):
     """Fetch prefixMap using DRS interface"""
     binding_str = "ncacn_ip_tcp:%s[print,seal]" % server
@@ -107,6 +109,7 @@ def _drs_fetch_pfm(server, samdb, creds, lp):
     pfm.num_mappings -= 1
     return (pfm, pfm_schi)
 
+
 def _pfm_verify(drs_pfm, ldb_pfm):
     errors = []
     if drs_pfm.num_mappings != ldb_pfm.num_mappings:
@@ -127,6 +130,7 @@ def _pfm_verify(drs_pfm, ldb_pfm):
             errors.append("[%2d] differences in (%s)" % (i, it_err))
     return errors
 
+
 def _pfm_schi_verify(drs_schi, ldb_schi):
     errors = []
     print(drs_schi.revision)
index c6c76e6db13dc4d2861ac1fa66c6682aab6a2008..a31c1287a71c65192ce4a9f5033abd774c15dc7e 100755 (executable)
@@ -56,6 +56,7 @@ import os
 
 from ldif import LDIFWriter
 
+
 class globals:
     def __init__(self):
         self.global_objs = {}
@@ -72,6 +73,7 @@ class globals:
             continue
         self.global_objs = {}
 
+
 def attid_equal(a1, a2):
     return (a1 & 0xffffffff) == (a2 & 0xffffffff)
 
index fbbf67e31220e7e95fd6fa1c962d2d26488d91ca..581529047cd810e80962bcbe7acf3d362982de23 100755 (executable)
@@ -72,6 +72,7 @@ creds.set_gensec_features(creds.get_gensec_features() | gensec.FEATURE_SEAL)
 # Tests start here
 #
 
+
 class SpeedTest(samba.tests.TestCase):
 
     def find_domain_sid(self, ldb):
@@ -120,6 +121,7 @@ url: www.example.com
         for dn in dn_list:
             delete_force(self.ldb_admin, dn)
 
+
 class SpeedTestAddDel(SpeedTest):
 
     def setUp(self):
@@ -165,6 +167,7 @@ class SpeedTestAddDel(SpeedTest):
         """
         self.run_bundle(10000)
 
+
 class AclSearchSpeedTest(SpeedTest):
 
     def setUp(self):
index 8418c246d979ff9c2b43d7443d499b40482c15c2..d03de6ed0c5abe0ba0dbfac0faaaf17ad44c3952 100755 (executable)
@@ -26,6 +26,7 @@ from selftesthelpers import *
 
 print("OPTIONS %s" % " ".join(smbtorture4_options), file=sys.stderr)
 
+
 def plansmbtorture4testsuite(name, env, options, modname=None):
     return selftesthelpers.plansmbtorture4testsuite(name, env, options,
                                                     target='samba4', modname=modname)
@@ -569,6 +570,8 @@ for env in ["ad_dc:local", "s4member:local", "nt4_dc:local", "ad_member:local",
 subunitrun = valgrindify(python) + " " + os.path.join(samba4srcdir, "scripting/bin/subunitrun")
 if extra_python is not None:
     subunitrun3 = valgrindify(extra_python) + " " + os.path.join(samba4srcdir, "scripting/bin/subunitrun")
+
+
 def planoldpythontestsuite(env, module, name=None, extra_path=[], environ={}, extra_args=[], py3_compatible=False):
     environ = dict(environ)
     py_path = list(extra_path)
index f29e29b29c44ffdc51d3d90c299c104e26d1d031..c030de0b54c017cbe531b24e36a2bb86c5643d41 100644 (file)
@@ -23,6 +23,7 @@ import drs_base
 
 from samba.dcerpc import drsuapi
 
+
 class DrsCracknamesTestCase(drs_base.DrsBaseTestCase):
     def setUp(self):
         super(DrsCracknamesTestCase, self).setUp()
index 45308e451fe545a2a085a406f5b846571914ba4e..776d424ac7e60700fad145275e2572d6745f7708 100644 (file)
@@ -41,6 +41,7 @@ from ldb import (
 )
 from samba.compat import cmp_fn
 
+
 class DrsBaseTestCase(SambaToolCmdTest):
     """Base class implementation for all DRS python tests.
        It is intended to provide common initialization and
index c74bb9d1ec138e278fe2c90935099244387835a6..918b71465dd02eca3e5a3e3b884f8143e1f6756b 100644 (file)
@@ -36,6 +36,7 @@ from ldb import SCOPE_BASE
 
 import drs_base
 
+
 class DrsFsmoTestCase(drs_base.DrsBaseTestCase):
 
     def setUp(self):
index d72159540de6c4d74b9f80bae70512a3e7491425..e396fc2f7e88dbde7682d1988cf39c020f7aadef 100644 (file)
@@ -46,6 +46,7 @@ from samba.ndr import ndr_unpack, ndr_pack
 from samba.compat import cmp_to_key_fn
 from samba.compat import cmp_fn
 
+
 def _linked_attribute_compare(la1, la2):
     """See CompareLinks() in MS-DRSR section 4.1.10.5.17"""
     la1, la1_target = la1
@@ -597,6 +598,7 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase):
         self.assertEqual(ctr.source_dsa_guid, misc.GUID(fsmo_owner["ntds_guid"]))
         self.assertEqual(ctr.source_dsa_invocation_id, misc.GUID(fsmo_owner["invocation_id"]))
 
+
 class DrsReplicaPrefixMapTestCase(drs_base.DrsBaseTestCase):
     def setUp(self):
         super(DrsReplicaPrefixMapTestCase, self).setUp()
@@ -945,6 +947,7 @@ class DrsReplicaPrefixMapTestCase(drs_base.DrsBaseTestCase):
         pfm.ctr.num_mappings += 1
         return pfm.ctr
 
+
 class DrsReplicaSyncSortTestCase(drs_base.DrsBaseTestCase):
     def setUp(self):
         super(DrsReplicaSyncSortTestCase, self).setUp()
index 17ad175b1f3304ed134822102a3e94dd7abea892..0cf112dbbd33406c19a7fa8d28ef4e56ac778afc 100644 (file)
@@ -45,6 +45,7 @@ import random
 from samba.dcerpc import drsuapi, security
 from samba.credentials import DONT_USE_KERBEROS
 
+
 class DrsReplicaSyncUnprivTestCase(drs_base.DrsBaseTestCase):
     """Confirm the behaviour of DsGetNCChanges for unprivileged users"""
 
index 66731e326c8c80b63d07c4e15e74222ff5d91ba7..cf79d5ef8f4bc38a7147bba0c55e8d06d49707bf 100644 (file)
@@ -26,6 +26,7 @@ import drs_base
 
 import time
 
+
 class LATestException(Exception):
     pass
 
index 74ba6789ce3b014c43b3c5bf96605328913fa5c1..0f0d480e0629fde08fbb40996aada589828b5cb4 100644 (file)
@@ -45,6 +45,7 @@ from ldb import (
 import drs_base, ldb
 from samba.dcerpc.drsuapi import *
 
+
 class DrsMoveObjectTestCase(drs_base.DrsBaseTestCase):
 
     def _ds_bind(self, server_name):
index 0ecc0bc5051a364237fe71ec44e782ad0dc8e38d..f23b082822d3f46548c7065084cacfb684ba94af 100644 (file)
@@ -43,6 +43,7 @@ from samba.credentials import Credentials
 import random
 import time
 
+
 def drs_get_rodc_partial_attribute_set(samdb, samdb1, exceptions=[]):
     '''get a list of attributes for RODC replication'''
     partial_attribute_set = drsuapi.DsPartialAttributeSet()
@@ -84,6 +85,7 @@ def drs_get_rodc_partial_attribute_set(samdb, samdb1, exceptions=[]):
     partial_attribute_set.num_attids = len(attids)
     return partial_attribute_set
 
+
 class DrsRodcTestCase(drs_base.DrsBaseTestCase):
     """Intended as a semi-black box test case for replication involving
        an RODC."""
index f66938cca2f56672c837395659770a173ff23972..71095a07d73ed727a106b67f6ce486ce86a59bac 100644 (file)
@@ -44,6 +44,7 @@ from samba.dcerpc import drsuapi, misc
 from samba.drs_utils import drs_DsBind
 from samba import dsdb
 
+
 class DrsReplSchemaTestCase(drs_base.DrsBaseTestCase):
 
     # prefix for all objects created
index b3b5d0835ca4ce16a92ccf0465a1782c53db2b90..9d21c594ee8300767f046a178005e8091af509ca 100644 (file)
@@ -36,6 +36,7 @@ import ldb
 from ldb import (
     SCOPE_BASE, LdbError, ERR_NO_SUCH_OBJECT)
 
+
 class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase):
     """Intended as a black box test case for DsReplicaSync
        implementation. It should test the behavior of this
index 4930a3b5254a13795a8e0a2da2cbeb8e9c5420b7..2763f23dd8768aff7801eff98e92f52076a206c0 100644 (file)
@@ -36,6 +36,7 @@ import ldb
 from ldb import (
     SCOPE_BASE, LdbError, ERR_NO_SUCH_OBJECT)
 
+
 class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase):
     """Intended as a black box test case for DsReplicaSync
        implementation. It should test the behavior of this
index cbeaec99155b3979f6f744f5f4b42fccb4335e6c..8a015f1dd05a8460cf06479c204a6566d1cdc432 100644 (file)
@@ -45,6 +45,7 @@ from samba.dbchecker import dbcheck
 from samba.ndr import ndr_pack
 from samba.dcerpc import security
 
+
 class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase):
     """Intended as a semi-black box test case for DsGetNCChanges
        implementation for extended operations. It should be testing
index a7ace22538bc1e71652f27fb1a04ff2f4330ed94..f5a83aaccf693cf987f9990d4f58b0f5371fd3df 100644 (file)
@@ -24,6 +24,7 @@ import os
 import ldb
 import drs_base
 
+
 class SambaToolDrsTests(drs_base.DrsBaseTestCase):
     """Blackbox test case for samba-tool drs."""
 
index fcd31c4b02ff5e3666ea73a408c5fbb03b8a7a3f..22b754fb6fb6695500684e15478201c32aa9b32e 100644 (file)
@@ -44,6 +44,7 @@ new_pass = os.environ["NEW_PASS"]
 # Tests start here
 #
 
+
 class Libnet_SetPwdTest(samba.tests.TestCase):
 
     ########################################################################################
index 145aed96cb8ce9de4a076b1af5d6bac1bced7ce4..d1139b603c6da2ce1df1aecdba417bd08fae769c 100755 (executable)
@@ -6,9 +6,11 @@ import sys, os
 import optparse
 import wintest
 
+
 def set_libpath(t):
     t.putenv("LD_LIBRARY_PATH", "${PREFIX}/lib")
 
+
 def set_krb5_conf(t):
     t.run_cmd("mkdir -p ${PREFIX}/etc")
     t.write_file("${PREFIX}/etc/krb5.conf", 
@@ -18,6 +20,7 @@ def set_krb5_conf(t):
 
     t.putenv("KRB5_CONFIG", '${PREFIX}/etc/krb5.conf')
 
+
 def build_s3(t):
     '''build samba3'''
     t.info('Building s3')
@@ -30,6 +33,7 @@ def build_s3(t):
     t.run_cmd('rm -rf ${PREFIX}')
     t.run_cmd('make install')
 
+
 def start_s3(t):
     t.info('Starting Samba3')
     t.chdir("${PREFIX}")
@@ -40,6 +44,7 @@ def start_s3(t):
     t.run_cmd(['sbin/smbd', "-D"])
     t.port_wait("${INTERFACE_IP}", 139)
 
+
 def test_wbinfo(t):
     t.info('Testing wbinfo')
     t.chdir('${PREFIX}')
@@ -103,6 +108,7 @@ def test_smbclient(t):
     child.sendline("cd ..")
     child.sendline("rmdir testdir")
 
+
 def create_shares(t):
     t.info("Adding test shares")
     t.chdir('${PREFIX}')
@@ -147,6 +153,7 @@ def prep_join_as_member(t, vm):
         panic action = xterm -e gdb --pid %d
     ''')
 
+
 def join_as_member(t, vm):
     '''join a windows domain as a member server'''
     t.setwinvars(vm)
@@ -159,6 +166,7 @@ def join_as_member(t, vm):
     t.cmd_contains("host -t A ${HOSTNAME}.${WIN_REALM}",
                    ['${HOSTNAME}.${WIN_REALM} has address'])
 
+
 def create_root_account(t, vm):
     t.setwinvars(vm)
     t.info("Creating 'root' account for testing Samba3 member server")
@@ -174,6 +182,7 @@ def create_root_account(t, vm):
     child.sendline("user edit disabled root no")
     child.expect("Set root's disabled flag")
 
+
 def test_join_as_member(t, vm):
     '''test the domain join'''
     t.setwinvars(vm)
index 0157fc73a9f32749a869736ca71f325c5f8e8f41..f2cbadfb4b8f280c61b03cfae19768ba2b290a60 100755 (executable)
@@ -5,9 +5,11 @@
 import sys, os
 import wintest, pexpect, time, subprocess
 
+
 def set_krb5_conf(t):
     t.putenv("KRB5_CONFIG", '${PREFIX}/private/krb5.conf')
 
+
 def build_s4(t):
     '''build samba4'''
     t.info('Building s4')
@@ -60,6 +62,7 @@ def start_s4(t):
                '--option', 'panic action=gnome-terminal -e "gdb --pid %d"', '--option', 'max protocol=nt1'])
     t.port_wait("${INTERFACE_IP}", 139)
 
+
 def test_smbclient(t):
     '''test smbclient against localhost'''
     t.info('Testing smbclient')
@@ -106,6 +109,7 @@ def test_dns(t):
     t.cmd_contains("host -t A ${HOSTNAME}.${LCREALM}",
                    ['${HOSTNAME}.${LCREALM} has address'])
 
+
 def test_kerberos(t):
     '''test that kerberos is OK'''
     t.info("Testing kerberos")
@@ -129,6 +133,7 @@ def run_winjoin(t, vm):
 
     t.run_winjoin(t, "${LCREALM}")
 
+
 def test_winjoin(t, vm):
     t.info("Checking the windows join is OK")
     smbclient = t.getvar("smbclient")
@@ -406,6 +411,7 @@ def prep_join_as_dc(t, vm):
     child = t.open_telnet("${WIN_HOSTNAME}", "${WIN_DOMAIN}\\administrator", "${WIN_PASS}", set_time=True)
     t.get_ipconfig(child)
 
+
 def join_as_dc(t, vm):
     '''join a windows domain as a DC'''
     t.setwinvars(vm)
index 3c7ac553c5b1f4d246c2534e8565fa58ff364c4c..6efa0c0340addae80806f896f9023d1af802f5e2 100644 (file)
@@ -6,6 +6,7 @@ import pexpect, subprocess
 import optparse
 import sys, os, time, re
 
+
 class wintest():
     '''testing of Samba against windows VMs'''