Running pylint 0.24.0 revealed 2 errors and 1 warning. Here is how I fixed them:
* jqueue.py: silenced E1101 * netutils.py: rewrote the list comprehension using extend() * watcher/__init__.py: fixed a missing format string parameter These changes are backwards-compatible with pylint 0.21.1. Signed-off-by: Andrea Spadaccini <[email protected]> --- lib/jqueue.py | 1 + lib/netutils.py | 2 +- lib/watcher/__init__.py | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/jqueue.py b/lib/jqueue.py index 7138993..2343ee8 100644 --- a/lib/jqueue.py +++ b/lib/jqueue.py @@ -2187,6 +2187,7 @@ class JobQueue(object): # Try to load from disk job = self.SafeLoadJobFromDisk(job_id, True, writable=False) + # pylint: disable=E1101 assert not job.writable, "Got writable job" if job: diff --git a/lib/netutils.py b/lib/netutils.py index 7a1b6d0..80c0219 100644 --- a/lib/netutils.py +++ b/lib/netutils.py @@ -583,7 +583,7 @@ class IP6Address(IPAddress): twoparts = address.split("::") sep = len(twoparts[0].split(":")) + len(twoparts[1].split(":")) parts = twoparts[0].split(":") - [parts.append("0") for _ in range(8 - sep)] + parts.extend(["0"] * (8 - sep)) parts += twoparts[1].split(":") else: parts = address.split(":") diff --git a/lib/watcher/__init__.py b/lib/watcher/__init__.py index 64c3f62..c84f3e8 100644 --- a/lib/watcher/__init__.py +++ b/lib/watcher/__init__.py @@ -106,8 +106,8 @@ def RunWatcherHooks(): try: results = utils.RunParts(hooks_dir) - except Exception: # pylint: disable=W0703 - logging.exception("RunParts %s failed: %s", hooks_dir) + except Exception, err: # pylint: disable=W0703 + logging.exception("RunParts %s failed: %s", hooks_dir, err) return for (relname, status, runresult) in results: -- 1.7.3.1
