On 11/01/2016 09:42 AM, Alexander Bokovoy wrote:
On ti, 01 marras 2016, Martin Babinsky wrote:
On 10/31/2016 05:23 PM, Alexander Bokovoy wrote:
See description. This is a regression since FreeIPA 4.4.0.




Hi Alexander,

Please link upstream ticket[1] to the commit message, not BZ.

I have put on my Travis hat and found:

1.) pep8 error:

./ipaserver/plugins/trust.py:1623:25: E128 continuation line
under-indented for visual indent

I know that this is a piece of code that was only moved around but it
should conform to pep8 anyway.

2.) unused variable:

Pylint is running, please wait ...
************* Module ipaserver.plugins.trust
ipaserver/plugins/trust.py:1619: [W0612(unused-variable),
trustdomain_del.execute] Unused variable 'entry')
Makefile:130: recipe for target 'pylint' failed
make: *** [pylint] Error 1

Also, if you just want to check if the domain exists, I think that you
can use `get_dn_if_exists` method of LDAPObject (you will get rid of
unused variable as a bonus):

diff --git a/ipaserver/plugins/trust.py b/ipaserver/plugins/trust.py
index 3540742..2cd4722 100644
--- a/ipaserver/plugins/trust.py
+++ b/ipaserver/plugins/trust.py
@@ -1615,8 +1615,7 @@ class trustdomain_del(LDAPDelete):

        for domain in keys[1]:
            try:
-                dn = self.obj.get_dn(keys[0], domain, trust_type=u'ad')
-                entry = ldap.get_entry(dn)
+                self.obj.get_dn_if_exists(keys[0], domain,
trust_type=u'ad')
            except errors.NotFound:
                if keys[0].lower() == domain:
                    raise errors.ValidationError(name='domain'

[1] https://fedorahosted.org/freeipa/ticket/6445
Thanks, I've fixed these issues.

Updated patch is attached.


Thanks, ACK.

Pushed to master: e8b94ef352400f9045837ed69266686b6b117301

rebased and pushed to ipa-4-4: bd74150aa28f92b0980f5a803d3591a118628e8f

--
Martin^3 Babinsky

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