On 06/19/2015 09:28 AM, Fraser Tweedale wrote:
> The attached patches fix upgrade issues when pki is also updated
> from pre 10.2.4.
> 
> pki dependency is bumped to 10.2.5 - the official builds should be
> done Friday (US time) but it is available from my copr[1].  If
> someone wants to add to official freeipa COPR in meantime the SRPM
> is here[2].
> 
> [1] https://copr.fedoraproject.org/coprs/ftweedal/freeipa/
> [2] https://ftweedal.fedorapeople.org/pki-core-10.2.5-0.2.fc21.src.rpm
> 
> Thanks,
> Fraser
> 

This may work, it would be of course cleaner to do this via context manager, in
lines with:

@contextmanager
def ldap_connect_autobind():
    if not api.Backend.ldap2.isconnected():
        api.Backend.ldap2.connect(autobind=True)
    try:
        yield
    finally:
        if api.Backend.ldap2.isconnected():
            api.Backend.ldap2.disconnect()

...

   try:
       with ldap_connect_autobind():
          # do API stuff
   except PublicError, e:
       ...


as that would also unbind it if exception is raised for example.

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to