abartlet at samba.org
Fri Aug 7 03:41:47 MDT 2009
On Fri, 2009-08-07 at 11:14 +0200, Oliver Liebel wrote:
> >> thank you very much!
> >> i call on you if i got some more questions.
> > No worries. Thanks!
> nearly done with ldb -ldapsearch.
> one more question:
> how can i handle the exception (when no rootdse is found,
> means, no slapds running). i tried this:
> ldapi_uri = "ldapi://" +
> urllib.quote(os.path.join(paths.private_dir, "ldap", "ldapi"), safe="")
> ldapi_db = Ldb(ldapi_uri)
> search_ol_rootdse = ldapi_db.search(base="", scope=SCOPE_BASE,
> except ldb.LdbError, e:
> message("ldap-search Output:")
> but i got this error, when slapd is not up:
> " except ldb.LdbError, e:
> NameError: global name 'ldb' is not defined"
> when i try:
> except ldapi_db.LdbError, e:
> instead, i got the following error:
> "AttributeError: 'Ldb' object has no attribute 'LdbError'"
But I think treating any error there as a good indication that there
isn't a slapd running should be fine.
Also see the other examples in provision.py, which do:
Authentication Developer, Samba Team http://samba.org
Samba Developer, Cisco Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: This is a digitally signed message part
More information about the samba-technical