Re: 2.4.0 patches need review

2011-03-02 Thread Rich Megginson
On 02/21/2011 02:29 PM, Michael Ströder wrote:
> HI!
>
> I've committed a larger patch contributed by Rich Megginson fixing SF#2829057
> [1] and adding generic support LDAPv3 extended operations. Many thanks to him.
>
> I've done some tests for [1] by successfully using the LDAP persistent search
> control against eDirectory and OpenDJ (OpenDS fork) and receive/decode the
> response control. Also a case which does not seem to work with recent
> python-ldap 2.3.13.
>
> But I think this large patch needs much more review and some decision
> regarding the arguments passed to and results returned by method
> LDAPObject.result4().
I've tested with 389 - extops work fine - dereference control (per entry 
return control) works fine.

About the arguments and return values to result4 - with the current code 
I have to do something like this:

 rtype, rdata, rmsgid, decoded_serverctrls, extop_rspoid, 
extop_rspval = srv.result4(msgid, 0, -1, 1)

That is, I only want the decoded_serverctrls, but I have to add items 
for extop_rspoid and extop_rspval even though I don't want them, because 
result4 always returns a 6-tuple, regardless of what the caller wants.  
Maybe this is the convention, to have to provide all of the optional 
return values, to make it consistent that result4 always returns a 
6-tuple?  Because it would be pretty easy for result4 to look at its 
arguments and do something like:
if add_extop:
   return a 6-tuple
else:
   return a 4-tuple

> So I'd like to encourage all the list readers to checkout CVS HEAD and play
> with it.
>
> Ciao, Michael.
>
> [1]
> http://sourceforge.net/tracker/?func=detail&aid=2829057&group_id=2072&atid=352072
>
> --
> Index, Search&  Analyze Logs and other IT data in Real-Time with Splunk
> Collect, index and harness all the fast moving IT data generated by your
> applications, servers and devices whether physical, virtual or in the cloud.
> Deliver compliance at lower cost and gain new business insights.
> Free Software Download: http://p.sf.net/sfu/splunk-dev2dev
> ___
> Python-LDAP-dev mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/python-ldap-dev


--
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
___
Python-LDAP-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev


Re: 2.4.0 patches need review

2011-03-02 Thread Rich Megginson
On 03/01/2011 01:13 PM, Michael Ströder wrote:
> Rich Megginson wrote:
>> About the arguments and return values to result4 - with the current code
>> I have to do something like this:
>>
>>  rtype, rdata, rmsgid, decoded_serverctrls, extop_rspoid,
>> extop_rspval = srv.result4(msgid, 0, -1, 1)
>>
>> That is, I only want the decoded_serverctrls, but I have to add items
>> for extop_rspoid and extop_rspval even though I don't want them, because
>> result4 always returns a 6-tuple, regardless of what the caller wants.
>> Maybe this is the convention, to have to provide all of the optional
>> return values, to make it consistent that result4 always returns a
>> 6-tuple?  Because it would be pretty easy for result4 to look at its
>> arguments and do something like:
>> if add_extop:
>>return a 6-tuple
>> else:
>>return a 4-tuple
> Look at the convenience wrapper method LDAPObject.extop_result() I've added
> recently. A similar method could be easily added for the case where the caller
> knows that one does not expect a ext op result. I consider this to be a more
> readable approach than looking at an argument.
Ok.  Sounds good.
> More ideas: I'd like to let the result-methods decode the response controls
> and ext op responses received. I'm thinking of adding a new optional keyword
> argument where one can pass in a dict([oid:class]) which can be used to
> automagically let the result method return instances of LDAPControl or
> ExtendedResponse.
>
> I'm also thinking about splitting LDAPControl into RequestControl and
> ResponseControl.
Both good ideas.
> More comments welcome.
>
> Ciao, Michael.


--
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
___
Python-LDAP-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev


Re: LDAP for Python 3.x

2011-03-02 Thread Michael Ströder
Dusan Stefanik wrote:
> I decided to take python-ldap-2.3.13 few days ago and I made som changes to 
> get it work on python3.
> Now I have working version for python3 (tested on Ubuntu 10.4 LTS x64 and 
> Debian Squeeze x64).
> 
> You can try it. It can be start point for new branche of python-ldap-py3.
> 
> I made only few tests (bind,search,del,add) - successfully.

Thanks for working on that. But given the fact that CVS HEAD now contains lots
of changes in Modules/ compared to 2.3.13 I'd really prefer to receive patches
against CVS HEAD. Would you mind doing so?

Ciao, Michael.

--
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
___
Python-LDAP-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev


Re: LDAP for Python 3.x

2011-03-02 Thread Dusan Stefanik
Hi Michael,

I will try do it.

Dusan


On 01/03/11 at 09:15pm, Michael Ströder wrote:
> Dusan Stefanik wrote:
> > I decided to take python-ldap-2.3.13 few days ago and I made som changes to 
> > get it work on python3.
> > Now I have working version for python3 (tested on Ubuntu 10.4 LTS x64 and 
> > Debian Squeeze x64).
> > 
> > You can try it. It can be start point for new branche of python-ldap-py3.
> > 
> > I made only few tests (bind,search,del,add) - successfully.
> 
> Thanks for working on that. But given the fact that CVS HEAD now contains lots
> of changes in Modules/ compared to 2.3.13 I'd really prefer to receive patches
> against CVS HEAD. Would you mind doing so?
> 
> Ciao, Michael.
> 

--
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
___
Python-LDAP-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/python-ldap-dev