From 7c3e8c838f0ada9ebae9dbb2bc5d84320c8431f2 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 11 Jan 2008 16:13:46 +0100 Subject: Python: Simplify code in a couple of places. Copy Andrew's changes from g53b5166. (This used to be commit f056f624958af79204c972eba3f85e36e93daed7) --- source4/scripting/python/samba/samdb.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4/scripting/python/samba/samdb.py') diff --git a/source4/scripting/python/samba/samdb.py b/source4/scripting/python/samba/samdb.py index 2af56d8d8e..353eaee198 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) -- cgit