Re: [Kolab-devel] Upgrade report 3.1 to 3.2 on Debian Wheezy

Paul Boddie <[email protected]>
Newsgroups gmane.comp.kde.devel.kolab
Message-ID <201402160330.32003.paul__16393.1831637912$1392517020$gmane$org@boddie.org.uk>
On Sunday 16. February 2014 02.36.24 Jeroen van Meeuwen (Kolab Systems) wrote:
> On 2014-02-16 00:52, Paul Boddie wrote:
> > 
> > http://git.kolab.org/pykolab/tree/kolabd/__init__.py#n223
> > 
> > In effect, the LDAP connection loop can never terminate because it will
> > never
> > get a true value from the connect method being called. I've attached a
> > patch
> > that should fix this, and it seems to have worked for me.
> 
> So the fix in this case is to first try/except connecting, then in try
> set connected to True.
> 
> Your patch added an else/break some place two tabs in, which I wasn't
> sure would need to be translated to 4*4 spaces or ended up in the middle
> of nowhere.

I must have had hard tabs enabled in my editor. Sorry about that! What you 
need is...

            while 1:
                try:
                    primary_auth.connect()
                except Exception, errmsg:
                    log.error(_("Could not connect to LDAP, is it running?"))
                    time.sleep(5)
                else:
                    break

...where exceptions keep the loop going and where a lack of exceptions cause a 
break of the loop.

Paul
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.