summaryrefslogtreecommitdiffstats
path: root/source4/scripting/python/samba/samdb.py
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-01-11 16:13:46 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-01-11 16:13:46 +0100
commit7c3e8c838f0ada9ebae9dbb2bc5d84320c8431f2 (patch)
treeb12fcf2bbc50e111e10c101f199749459e65f4a1 /source4/scripting/python/samba/samdb.py
parent35c597161b8af4b39e2c99b35b6782010b3dcb78 (diff)
downloadsamba-7c3e8c838f0ada9ebae9dbb2bc5d84320c8431f2.tar.gz
samba-7c3e8c838f0ada9ebae9dbb2bc5d84320c8431f2.tar.xz
samba-7c3e8c838f0ada9ebae9dbb2bc5d84320c8431f2.zip
Python: Simplify code in a couple of places. Copy Andrew's changes from g53b5166.
(This used to be commit f056f624958af79204c972eba3f85e36e93daed7)
Diffstat (limited to 'source4/scripting/python/samba/samdb.py')
-rw-r--r--source4/scripting/python/samba/samdb.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/scripting/python/samba/samdb.py b/source4/scripting/python/samba/samdb.py
index 2af56d8d8eb..353eaee1984 100644
--- a/source4/scripting/python/samba/samdb.py
+++ b/source4/scripting/python/samba/samdb.py
@@ -60,7 +60,7 @@ description: %s
:param sid: SID of the NT-side of the mapping.
:param unixname: Unix name to map to.
"""
- res = self.search(ldb.Dn(self, domaindn), ldb.SCOPE_SUBTREE,
+ res = self.search(domaindn, ldb.SCOPE_SUBTREE,
"objectSid=%s" % sid, ["dn"])
assert len(res) == 1, "Failed to find record for objectSid %s" % sid
@@ -103,7 +103,7 @@ userAccountControl: %u
res = self.search("", SCOPE_BASE, "defaultNamingContext=*",
["defaultNamingContext"])
assert(len(res) == 1 and res[0].defaultNamingContext is not None)
- domain_dn = res[0].defaultNamingContext
+ domain_dn = res[0]["defaultNamingContext"][0]
assert(domain_dn is not None)
dom_users = self.searchone(domain_dn, "dn", "name=Domain Users")
assert(dom_users is not None)