This one is even more correct.

On 04/24/2015 04:05 PM, Oleg Fayans wrote:
> Corresponding ticket is
> https://fedorahosted.org/freeipa/ticket/5002
>
>
>

-- 
Oleg Fayans
Quality Engineer
FreeIPA team
RedHat.

>From c0b7322c804e9cc327b2caa248e2b1d6614e4e06 Mon Sep 17 00:00:00 2001
From: ofayans <ofay...@redhat.com>
Date: Fri, 24 Apr 2015 15:40:14 +0200
Subject: [PATCH 1/2] Fixed incorrect ldap_uri population

---
 ipaserver/plugins/ldap2.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ipaserver/plugins/ldap2.py b/ipaserver/plugins/ldap2.py
index fd4ed29..59ebaf7 100644
--- a/ipaserver/plugins/ldap2.py
+++ b/ipaserver/plugins/ldap2.py
@@ -79,9 +79,11 @@ class ldap2(LDAPClient, CrudBackend):
 
     @property
     def ldap_uri(self):
-        try:
-             return self.__ldap_uri or self.api.env.ldap_uri
+        if '__ldap_uri' in dir(self) and self.__ldap_uri:
+            return self.__ldap_uri
-        except AttributeError:
+        elif self.api.env.ldap_uri:
+            return self.api.env.ldap_uri
+        else:
             return 'ldap://example.com'
 
     @ldap_uri.setter
-- 
2.1.0

-- 
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