Re: Python3 and LDAP

2009-09-09 Thread Michael Ströder
Bruno Aguirre wrote: > > Hi to all, I'd like to know if there's a version (alpha, beta or stable) > to use ldap in python 3. There are still some things to consider. Please dig the mailing list's archive for some discussion. Would you personally be willing to put some effort into the C extension

Python3 and LDAP

2009-09-09 Thread Bruno Aguirre
Hi to all, I'd like to know if there's a version (alpha, beta or stable) to use ldap in python 3. Thanks for your time. -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your re

Re: What's the best way to replace value of attribute which can handle multiple values?

2009-09-09 Thread Michael Ströder
Zhang Huangbin wrote: > NO_SUCH_ATTRIBUTE: {'info': 'modify/delete: enabledService: no such > value', 'desc': 'No such attribute'} This means the attribute 'enabledService' is not available in the entry at all. So you can't remove a certain attribute value from it. Ciao, Michael. -

Re: What's the best way to replace value of attribute which can handle multiple values?

2009-09-09 Thread Zhang Huangbin
On Sep 9, 2009, at 9:32 PM, Michael Ströder wrote: > Zhang Huangbin wrote: >> NO_SUCH_ATTRIBUTE: {'info': 'modify/delete: enabledService: no such >> value', 'desc': 'No such attribute'} > > This means the attribute 'enabledService' is not available in the > entry at > all. So you can't remove a

Re: What's the best way to replace value of attribute which can handle multiple values?

2009-09-09 Thread Zhang Huangbin
On Sep 9, 2009, at 9:48 PM, Michael Ströder wrote: > BTW: That's why > ldap.modlist.modifyModlist() was implemented. Any example? There is no example in official python-ldap document: http://www.python-ldap.org/doc/html/ldap-modlist.html?highlight=modifymodlist#ldap.modlist.modifyModlist Thank

Re: What's the best way to replace value of attribute which can handle multiple values?

2009-09-09 Thread Michael Ströder
Zhang Huangbin wrote: > > On Sep 9, 2009, at 9:48 PM, Michael Ströder wrote: > >> BTW: That's why >> ldap.modlist.modifyModlist() was implemented. > > Any example? > > There is no example in official python-ldap document: > http://www.python-ldap.org/doc/html/ldap-modlist.html?highlight=modifym

Re: What's the best way to replace value of attribute which can handle multiple values?

2009-09-09 Thread Michael Ströder
Zhang Huangbin wrote: > > On Sep 9, 2009, at 9:32 PM, Michael Ströder wrote: > >> Zhang Huangbin wrote: >>> NO_SUCH_ATTRIBUTE: {'info': 'modify/delete: enabledService: no such >>> value', 'desc': 'No such attribute'} >> >> This means the attribute 'enabledService' is not available in the >> entry

Re: What's the best way to replace value of attribute which can handle multiple values?

2009-09-09 Thread Zhang Huangbin
On Sep 9, 2009, at 6:02 PM, Michael Ströder wrote: > Zhang Huangbin wrote: >> On Sep 9, 2009, at 4:54 PM, Michael Ströder wrote: If cn=cn2 is not exist, [(ldap.MOD_DELETE, 'cn', 'cn2')] will raise an error. >>> Could you please post the error raised and mention with which server >>

Re: What's the best way to replace value of attribute which can handle multiple values?

2009-09-09 Thread Michael Ströder
Zhang Huangbin wrote: > On Sep 9, 2009, at 4:54 PM, Michael Ströder wrote: >>> If cn=cn2 is not exist, [(ldap.MOD_DELETE, 'cn', 'cn2')] will raise >>> an >>> error. >> Could you please post the error raised and mention with which server >> you're >> testing? >> >> I'd try [(ldap.MOD_DELETE, 'cn

Re: What's the best way to replace value of attribute which can handle multiple values?

2009-09-09 Thread Zhang Huangbin
Thanks for your reply, Michael. :) On Sep 9, 2009, at 4:54 PM, Michael Ströder wrote: >> If cn=cn2 is not exist, [(ldap.MOD_DELETE, 'cn', 'cn2')] will raise >> an >> error. > > Could you please post the error raised and mention with which server > you're > testing? > > I'd try [(ldap.MOD_DELET

Re: What's the best way to replace value of attribute which can handle multiple values?

2009-09-09 Thread Michael Ströder
Zhang Huangbin wrote: > What's the best way to 'replace' value of attribute which can handle > multiple values? > > Such as: > > dn: uid=myuid,dc=example,dc=com > cn: cn1 > cn: cn2 > cn: cn3 > > My purpose is to get ldif like this (no cn=cn2 any more): > > dn: uid=myuid,dc=example,dc=com > cn