[Freeipa-devel] [PATCH] 0037 make-lint fails on Fedora 16/Rawhide
Martin Kosek
mkosek at redhat.com
Tue Nov 29 09:44:40 UTC 2011
On Mon, 2011-11-28 at 17:26 +0200, Alexander Bokovoy wrote:
> On Mon, 28 Nov 2011, Alexander Bokovoy wrote:
>
> > Hi,
> >
> > Attached are fixes for ldap.LDAPObject.add_s(self, dn, modlist) uses
> > which now don't pass 'make-lint' on Fedora 16/Rawhide.
> >
> > --
> > / Alexander Bokovoy
>
> > >From dd866262c98be779a094a617975145e2fb1e0dd1 Mon Sep 17 00:00:00 2001
> > From: Alexander Bokovoy <abokovoy at redhat.com>
> > Date: Mon, 28 Nov 2011 14:21:17 +0200
> > Subject: [PATCH] Be more explicit when passing Entry class to
> > ldap.LDAPObject.add_s()
> >
> > ldap.LDAPObject.add_s(self, dn, modlist) requires two positional arguments.
> > We used to pass our Entry class which implements dictionary access that gives
> > proper way to pass the positional arguments, but PyLint in Fedora 16/Rawhide
> > became more strict about that and can't infer dictionary interface through
> > static checking.
> >
> > Thus, we need to explicitly annotate dictionary passing with **entry syntax.
> > This has additional benefit to remind that we deal with multiple arguments here.
> Self-NACK, doesn't really work this way. I'm still looking at better
> approach but intermediate solution is to use pylint hints.
>
> Conservative patch is attached.
>
What about other add_s(entry) calls? I see we call it this way on more
places, especially in replication.py:
$ git grep "add_s(e"
ipaserver/install/cainstance.py: ld.add_s(entry_dn, entry)
ipaserver/install/krbinstance.py: self.admin_conn.add_s(entry) #pylint: disable=E1120
ipaserver/install/krbinstance.py: self.admin_conn.add_s(entry) #pylint: disable=E1120
ipaserver/install/replication.py: conn.add_s(ent)
ipaserver/install/replication.py: conn.add_s(entry)
ipaserver/install/replication.py: conn.add_s(entry)
ipaserver/install/replication.py: self.conn.add_s(entry)
ipaserver/install/replication.py: conn.add_s(entry)
ipaserver/install/replication.py: a_conn.add_s(entry)
ipaserver/install/replication.py: self.conn.add_s(entry)
ipaserver/install/service.py: conn.add_s(entry) #pylint: disable=E1120
Should we patch ipa-2-1 branch as well? If we do another release for
F-16 we want to have pylint check clean. We would need a rebased patch
for ipa-2-1 branch in this case.
Martin
More information about the Freeipa-devel
mailing list