diff options
Diffstat (limited to 'source4/scripting/python/samba/netcmd')
4 files changed, 16 insertions, 16 deletions
diff --git a/source4/scripting/python/samba/netcmd/domainlevel.py b/source4/scripting/python/samba/netcmd/domainlevel.py index 1874191e1f..ecd835ddd2 100644 --- a/source4/scripting/python/samba/netcmd/domainlevel.py +++ b/source4/scripting/python/samba/netcmd/domainlevel.py @@ -76,20 +76,20 @@ class cmd_domainlevel(Command): samdb = SamDB(url=H, session_info=system_session(), credentials=creds, lp=lp) - domain_dn = SamDB.domain_dn(samdb) + domain_dn = samdb.domain_dn() res_forest = samdb.search("CN=Partitions,CN=Configuration," + domain_dn, scope=ldb.SCOPE_BASE, attrs=["msDS-Behavior-Version"]) - assert(len(res_forest) == 1) + assert len(res_forest) == 1 res_domain = samdb.search(domain_dn, scope=ldb.SCOPE_BASE, attrs=["msDS-Behavior-Version", "nTMixedDomain"]) - assert(len(res_domain) == 1) + assert len(res_domain) == 1 res_dc_s = samdb.search("CN=Sites,CN=Configuration," + domain_dn, scope=ldb.SCOPE_SUBTREE, expression="(objectClass=nTDSDSA)", attrs=["msDS-Behavior-Version"]) - assert(len(res_dc_s) >= 1) + assert len(res_dc_s) >= 1 try: level_forest = int(res_forest[0]["msDS-Behavior-Version"][0]) diff --git a/source4/scripting/python/samba/netcmd/dsacl.py b/source4/scripting/python/samba/netcmd/dsacl.py index 17982b8119..0149d375be 100644 --- a/source4/scripting/python/samba/netcmd/dsacl.py +++ b/source4/scripting/python/samba/netcmd/dsacl.py @@ -105,7 +105,7 @@ class cmd_ds_acl_set(Command): return ndr_unpack(security.descriptor, desc) def get_domain_sid(self, samdb): - res = samdb.search(base=SamDB.domain_dn(samdb), + res = samdb.search(base=samdb.domain_dn(), expression="(objectClass=*)", scope=SCOPE_BASE) return ndr_unpack( security.dom_sid,res[0]["objectSid"][0]) diff --git a/source4/scripting/python/samba/netcmd/fsmo.py b/source4/scripting/python/samba/netcmd/fsmo.py index bcf80ce290..688602012b 100644 --- a/source4/scripting/python/samba/netcmd/fsmo.py +++ b/source4/scripting/python/samba/netcmd/fsmo.py @@ -65,10 +65,10 @@ all=all of the above"""), "1", ldb.FLAG_MOD_REPLACE, "becomeRidMaster") elif role == "pdc": - domain_dn = SamDB.domain_dn(samdb) + domain_dn = samdb.domain_dn() res = samdb.search(domain_dn, scope=ldb.SCOPE_BASE, attrs=["objectSid"]) - assert(len(res) == 1) + assert len(res) == 1 sid = res[0]["objectSid"][0] m["becomePdc"]= ldb.MessageElement( sid, ldb.FLAG_MOD_REPLACE, @@ -93,9 +93,9 @@ all=all of the above"""), def seize_role(self, role, samdb, force): res = samdb.search("", scope=ldb.SCOPE_BASE, attrs=["dsServiceName"]) - assert(len(res) == 1) + assert len(res) == 1 serviceName = res[0]["dsServiceName"][0] - domain_dn = SamDB.domain_dn(samdb) + domain_dn = samdb.domain_dn() m = ldb.Message() if role == "rid": m.dn = ldb.Dn(samdb, self.rid_dn) @@ -138,7 +138,7 @@ all=all of the above"""), samdb = SamDB(url=host, session_info=system_session(), credentials=creds, lp=lp) - domain_dn = SamDB.domain_dn(samdb) + domain_dn = samdb.domain_dn() self.infrastructure_dn = "CN=Infrastructure," + domain_dn self.naming_dn = "CN=Partitions,CN=Configuration," + domain_dn self.schema_dn = "CN=Schema,CN=Configuration," + domain_dn @@ -146,27 +146,27 @@ all=all of the above"""), res = samdb.search(self.infrastructure_dn, scope=ldb.SCOPE_BASE, attrs=["fSMORoleOwner"]) - assert(len(res) == 1) + assert len(res) == 1 self.infrastructureMaster = res[0]["fSMORoleOwner"][0] res = samdb.search(domain_dn, scope=ldb.SCOPE_BASE, attrs=["fSMORoleOwner"]) - assert(len(res) == 1) + assert len(res) == 1 self.pdcEmulator = res[0]["fSMORoleOwner"][0] res = samdb.search(self.naming_dn, scope=ldb.SCOPE_BASE, attrs=["fSMORoleOwner"]) - assert(len(res) == 1) + assert len(res) == 1 self.namingMaster = res[0]["fSMORoleOwner"][0] res = samdb.search(self.schema_dn, scope=ldb.SCOPE_BASE, attrs=["fSMORoleOwner"]) - assert(len(res) == 1) + assert len(res) == 1 self.schemaMaster = res[0]["fSMORoleOwner"][0] res = samdb.search(self.rid_dn, scope=ldb.SCOPE_BASE, attrs=["fSMORoleOwner"]) - assert(len(res) == 1) + assert len(res) == 1 self.ridMaster = res[0]["fSMORoleOwner"][0] if subcommand == "show": diff --git a/source4/scripting/python/samba/netcmd/pwsettings.py b/source4/scripting/python/samba/netcmd/pwsettings.py index dda009ae06..8748bc5e0d 100644 --- a/source4/scripting/python/samba/netcmd/pwsettings.py +++ b/source4/scripting/python/samba/netcmd/pwsettings.py @@ -72,7 +72,7 @@ class cmd_pwsettings(Command): samdb = SamDB(url=H, session_info=system_session(), credentials=creds, lp=lp) - domain_dn = SamDB.domain_dn(samdb) + domain_dn = samdb.domain_dn() res = samdb.search(domain_dn, scope=ldb.SCOPE_BASE, attrs=["pwdProperties", "pwdHistoryLength", "minPwdLength", "minPwdAge", "maxPwdAge"]) |