1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-21 12:59:09 +03:00

s4-python: Fix formatting, use standard convention to call instance methods.

This commit is contained in:
Jelmer Vernooij
2010-04-08 23:18:17 +02:00
parent ae6d306c68
commit 7a6f1c7842
6 changed files with 51 additions and 49 deletions

View File

@ -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])