extended provision-backend

Oliver Liebel oliver at itc.li
Fri Aug 7 03:46:35 MDT 2009


Oliver Liebel schrieb:
>>> 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:
>
>  try:
>         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,
>                           expression="(objectClass=OpenLDAProotDSE)");
>         message(search_ol_rootdse)
>
>     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'"
>
>
> thanks,
> oliver
>   
got it. just used LdbError, and everythings as wanted.
ill commit  all changes ( including pid verify + ldb-search)
in a few hours.

thanks,
oliver

>
>
>   



More information about the samba-technical mailing list