Re: [PATCH stable-2.15 00/37] Cleanup for pylint 1.6.4

2016-12-05 Thread 'Brian Foley' via ganeti-devel
On Mon, Dec 05, 2016 at 03:21:32PM +, Federico Pareschi wrote:
>I'm replying here for all the 37 patches, after addressing all the
>comments,
>I'd say this is an LGTM for me :)
>Thanks Brian for the good work.
>Cheers,
>Morg.

Committed, thanks. Now, onto the next batch... :)

Cheers,
Brian.


Re: [PATCH stable-2.15 00/37] Cleanup for pylint 1.6.4

2016-12-05 Thread 'Federico Pareschi' via ganeti-devel
I'm replying here for all the 37 patches, after addressing all the comments,
I'd say this is an LGTM for me :)

Thanks Brian for the good work.

Cheers,
Morg.

On 5 December 2016 at 12:37, 'Iustin Pop' via ganeti-devel <
ganeti-devel@googlegroups.com> wrote:

> On 5 December 2016 at 13:04, 'Brian Foley' via ganeti-devel <
> ganeti-devel@googlegroups.com> wrote:
>
>> On Mon, Dec 05, 2016 at 12:01:14PM +0100, Iustin Pop wrote:
>> >Quick question: is there a reason to keep that compat, as opposed to
>> >switching the "blessed" (and required) pylint version to 1.6.4?
>> >(If this is addressed in the patch series, sorry, didn't read the
>> >patches)
>> >iustin
>>
>> Hi Iustin,
>>
>> no, there isn't any very good reason, I was just playing it safe, and
>> kinda
>> assumed that make dist or the debian build process might run pylint, but
>> it
>> appears tht neither do.
>>
>
> As long as we require a fixed version, it's not really feasible to do so.
> Similarly how -Werror is only enabled in developer builds, I guess.
>
> In that case, I'll move us to requiring 1.6.4, and remove a couple of the
>> compatibility workarounds.
>>
>
> Yes please, that sounds cleaner.
>
> thanks,
> iustin
>


Re: [PATCH stable-2.15 00/37] Cleanup for pylint 1.6.4

2016-12-05 Thread 'Iustin Pop' via ganeti-devel
On 5 December 2016 at 13:04, 'Brian Foley' via ganeti-devel <
ganeti-devel@googlegroups.com> wrote:

> On Mon, Dec 05, 2016 at 12:01:14PM +0100, Iustin Pop wrote:
> >Quick question: is there a reason to keep that compat, as opposed to
> >switching the "blessed" (and required) pylint version to 1.6.4?
> >(If this is addressed in the patch series, sorry, didn't read the
> >patches)
> >iustin
>
> Hi Iustin,
>
> no, there isn't any very good reason, I was just playing it safe, and kinda
> assumed that make dist or the debian build process might run pylint, but it
> appears tht neither do.
>

As long as we require a fixed version, it's not really feasible to do so.
Similarly how -Werror is only enabled in developer builds, I guess.

In that case, I'll move us to requiring 1.6.4, and remove a couple of the
> compatibility workarounds.
>

Yes please, that sounds cleaner.

thanks,
iustin


Re: [PATCH stable-2.15 00/37] Cleanup for pylint 1.6.4

2016-12-05 Thread 'Brian Foley' via ganeti-devel
On Mon, Dec 05, 2016 at 12:01:14PM +0100, Iustin Pop wrote:
>Quick question: is there a reason to keep that compat, as opposed to
>switching the "blessed" (and required) pylint version to 1.6.4?
>(If this is addressed in the patch series, sorry, didn't read the
>patches)
>iustin

Hi Iustin,

no, there isn't any very good reason, I was just playing it safe, and kinda
assumed that make dist or the debian build process might run pylint, but it
appears tht neither do.

In that case, I'll move us to requiring 1.6.4, and remove a couple of the
compatibility workarounds.

Cheers,
Brian.


Re: [PATCH stable-2.15 00/37] Cleanup for pylint 1.6.4

2016-12-05 Thread 'Iustin Pop' via ganeti-devel
On 5 December 2016 at 11:35, 'Brian Foley' via ganeti-devel <
ganeti-devel@googlegroups.com> wrote:

> Ganeti's python code passes the pylint checks in the version of pylint
> included with Debian Jessie. Unfortunately this is a really old pylint
> (0.26 from 2012) and the latest stable pylint (1.6.4 from 2016) has a
> lot of additional checks. Ganeti produces many many warnings and errors
> when run against 1.6.4.
>
> This patchset is a first cut at fixing these, while still maintaining
>  compatibility with pylint 0.26.
>

Quick question: is there a reason to keep that compat, as opposed to
switching the "blessed" (and required) pylint version to 1.6.4?

(If this is addressed in the patch series, sorry, didn't read the patches)

iustin


[PATCH stable-2.15 00/37] Cleanup for pylint 1.6.4

2016-12-05 Thread 'Brian Foley' via ganeti-devel
Ganeti's python code passes the pylint checks in the version of pylint
included with Debian Jessie. Unfortunately this is a really old pylint
(0.26 from 2012) and the latest stable pylint (1.6.4 from 2016) has a
lot of additional checks. Ganeti produces many many warnings and errors
when run against 1.6.4.

This patchset is a first cut at fixing these, while still maintaining
 compatibility with pylint 0.26.

Brian Foley (37):
  Cleanup: Remove some unnecessary if (...) parens
  Cleanup: Simplify boolean assignment
  Cleanup: Use FOO not in BAR instead of not FOO in BAR
  Cleanup: del is a statement not a function
  Cleanup: Replace map/filters with list comprehensions
  Cleanup: Fix for/else with no break in AddAuthorizedKeys
  Cleanup: StartInstance and RebootInstance return None
  Cleanup: Remove unused format key
  Cleanup: Iterate dict rather than key list
  Cleanup: Remove some unneeded pylint disables
  Cleanup: Fix unidiomatic-typecheck
  Cleanup: Remove unused/duplicate module/fn import
  Fix pylint >1.4 pycurl no-member warnings
  Disable pylint warning about unrecognised --disable
  Remove pylint's star-args warning
  Disable pylint warning about use of deprecated pragmas
  Disable some pylint unused-import warnings
  Disable pylint import-self warning
  Disable pylint invalid-name warning
  Disable pylint eval-used warning
  Disable incorect pylint simplify-if-statement warning
  Disable pylint misplaced-comparison-constant warning
  Disable pylint unpacking-non-sequence warning
  Disable incorrect pylint not-callable warning
  Disable pylint unused-wildcard-import warning
  Disable unwanted pylint wrong-import-position warnings
  Disable pylint bare-except warning
  Disable pylint unsubscriptable-object warning
  Quell consider-using-enumerate warning
  Quell bad-whitespace warning
  Quell trailing newline
  Remove pylint tests removed in pylint 2.0
  Quell too-many-boolean-expressions
  Use default value lambda param to avoid cell-var-from-loop
  Quell cell-var-from-loop warning
  Quell the pylint wrong-import-order warnings
  Quell pylint socket.timeout warning

 Makefile.am   | 10 -
 autotools/build-bash-completion   | 14 +
 autotools/build-rpc   |  2 +-
 autotools/check-imports   |  5 +++--
 configure.ac  |  4 
 lib/__init__.py   |  2 +-
 lib/backend.py| 10 -
 lib/build/sphinx_ext.py   | 10 +
 lib/cli.py| 30 +--
 lib/cli_opts.py   |  7 ---
 lib/client/gnt_cluster.py | 15 ++
 lib/client/gnt_debug.py   |  8 +++
 lib/client/gnt_instance.py|  6 +++---
 lib/client/gnt_network.py |  1 -
 lib/cmdlib/backup.py  |  3 ++-
 lib/cmdlib/cluster/__init__.py|  2 +-
 lib/cmdlib/cluster/verify.py  |  9 
 lib/cmdlib/instance.py|  6 +++---
 lib/cmdlib/instance_create.py | 12 +--
 lib/cmdlib/instance_migration.py  |  3 ++-
 lib/cmdlib/instance_storage.py|  5 ++---
 lib/cmdlib/instance_utils.py  |  4 ++--
 lib/cmdlib/network.py |  4 ++--
 lib/cmdlib/query.py   |  2 --
 lib/cmdlib/test.py|  1 -
 lib/compat.py |  8 +++
 lib/config/__init__.py| 13 ++--
 lib/config/verify.py  |  4 ++--
 lib/errors.py |  1 -
 lib/http/__init__.py  |  5 +++--
 lib/http/auth.py  |  4 ++--
 lib/http/client.py|  6 --
 lib/hypervisor/hv_kvm/__init__.py |  4 ++--
 lib/hypervisor/hv_kvm/monitor.py  |  4 ++--
 lib/hypervisor/hv_xen.py  |  4 ++--
 lib/jqueue/__init__.py|  2 +-
 lib/luxi.py   |  9 
 lib/masterd/iallocator.py |  8 +++
 lib/metad.py  |  4 ++--
 lib/objects.py| 10 -
 lib/ovf.py|  5 +++--
 lib/rapi/baserlib.py  |  2 +-
 lib/rapi/client.py|  7 ---
 lib/rapi/testutils.py | 12 ++-
 lib/rpc/node.py   | 16 +++---
 lib/rpc_defs.py   |  2 +-
 lib/server/masterd.py |  2 +-
 lib/server/noded.py   |  6 +-
 lib/server/rapi.py