[Freeipa-devel] [PATCH 0001] Fixed incorrect ldap_uri population
Jan Cholasta
jcholast at redhat.com
Tue Apr 28 11:18:35 UTC 2015
Hi,
Dne 24.4.2015 v 16:27 Oleg Fayans napsal(a):
> 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
thanks for the patch, but the bug is purely hypothetical, as the
__ldap_uri attribute is always set.
Anyway, you shouldn't use "'name' in dir(obj)" to check if attribute is
set, there is "hasattr(obj, 'name')" for that.
Also, "__ldap_uri" starts with two underscores, so the name is mangled
to "_ldap2__ldap_uri", which means the check in your patch will always
fail and ldap_uri will always return self.api.env.ldap_uri, which is in
fact more wrong than the current behavior.
Honza
--
Jan Cholasta
More information about the Freeipa-devel
mailing list