• Iustin Pop's avatar
    Fix warnings/errors with newer pylint · 8ad0da1e
    Iustin Pop authored
    To help developing Ganeti on newer distributions, let's try to fix
    pylint warnings/errors. I'm using pylint from current Debian wheezy:
    pylint 0.25.1, astng 0.23.1, common 0.58.0, and we have 3 things that
    needs fixing.
    First, a really wide "except", with the silencing in the wrong
    place. I'm not sure why this doesn't have "except Exception", so let's
    add it. However, pylint still complains about "Catching too general
    exception", even though we do want to catch both system and our
    exception, so let's add a silence for W0703. It's true that we
    shouldn't catch KeyboardInterrupt and friends, but that should be
    cleaned up on the master branch.
    Second, pylint complains about "redefining name builtin tuple",
    because we do some pattern matching in the except blocks in
    netutils. This seems to be a false positive, but let's clean the code
    around this.
    And finally, type inference again goes bad, so let's silence E1103
    with its "boolean doesn't have 'get' method".
    After this, I can run "make lint", and by extension "make
    commit-check" on Debian Wheezy, yay! We might be able to bump our
    required pylint versions to something not ancient…
    Signed-off-by: default avatarIustin Pop <iustin@google.com>
    Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>