From: Iustin Pop <[email protected]> Some of the them are fixed (e.g. unused variable), others are simply silenced especially when there's no context of why the code was committed as such (and I don't want to change things which are non-obvious).
Signed-off-by: Iustin Pop <[email protected]> --- lib/backend.py | 1 + lib/http/client.py | 1 + lib/http/server.py | 10 +++++----- lib/storage/base.py | 1 + lib/storage/bdev.py | 3 +-- src/Ganeti/Config.hs | 2 +- src/Ganeti/JQScheduler.hs | 5 +++-- src/Ganeti/Rpc.hs | 2 +- 8 files changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/backend.py b/lib/backend.py index f0ce380..5df30a5 100644 --- a/lib/backend.py +++ b/lib/backend.py @@ -3807,6 +3807,7 @@ def BlockdevGetmirrorstatusMulti(disks): lvs_cache = None is_plain_disk = compat.any([_CheckForPlainDisk(d) for d in disks]) if is_plain_disk: + # pylint: disable=W0212 lvs_cache = bdev.LogicalVolume._GetLvGlobalInfo() for disk in disks: try: diff --git a/lib/http/client.py b/lib/http/client.py index 4da5aec..7cea000 100644 --- a/lib/http/client.py +++ b/lib/http/client.py @@ -227,6 +227,7 @@ class _PendingRequest(object): try: # LOCAL_* options added in pycurl 7.21.5 + # pylint: disable=E1101 from_str = "from %s:%s " % ( curl.getinfo(pycurl.LOCAL_IP), curl.getinfo(pycurl.LOCAL_PORT) diff --git a/lib/http/server.py b/lib/http/server.py index ffdf790..993745c 100644 --- a/lib/http/server.py +++ b/lib/http/server.py @@ -423,8 +423,8 @@ class HttpServerRequestExecutor(object): try: http.Handshake(sock, self.WRITE_TIMEOUT) except http.HttpSessionHandshakeUnexpectedEOF: - logging.debug("Unexpected EOF from %s:%s" % (client_addr[0], - client_addr[1])) + logging.debug("Unexpected EOF from %s:%s", + client_addr[0], client_addr[1]) # Ignore rest return @@ -611,9 +611,9 @@ class HttpServer(http.HttpBase, asyncore.dispatcher): self.request_executor(self, self.handler, connection, client_addr) t_end = time.time() logging.debug("Request from %s:%s executed in: %.4f" - " [setup: %.4f] [workers: %d]" % ( - client_addr[0], client_addr[1], t_end - t_start, - t_setup - t_start, len(self._children))) + " [setup: %.4f] [workers: %d]", + client_addr[0], client_addr[1], t_end - t_start, + t_setup - t_start, len(self._children)) except Exception: # pylint: disable=W0703 logging.exception("Error while handling request from %s:%s", diff --git a/lib/storage/base.py b/lib/storage/base.py index 461fdad..000f5db 100644 --- a/lib/storage/base.py +++ b/lib/storage/base.py @@ -96,6 +96,7 @@ class BlockDev(object): def __eq__(self, other): if not isinstance(self, type(other)): return False + # pylint: disable=W0212 return (self._children == other._children and self.dev_path == other.dev_path and self.unique_id == other.unique_id and diff --git a/lib/storage/bdev.py b/lib/storage/bdev.py index 1f95004..e0f16ed 100644 --- a/lib/storage/bdev.py +++ b/lib/storage/bdev.py @@ -510,10 +510,9 @@ class LogicalVolume(base.BlockDev): logging.warning("lvs command returned an empty output, the LV cache will" "be empty!") return {} - info = {} return dict([LogicalVolume._ParseLvInfoLine(line, sep) for line in out]) - def Attach(self, lv_info=None): + def Attach(self, lv_info=None): # pylint: disable=W0221 """Attach to an existing LV. This method will try to see if an existing and active LV exists diff --git a/src/Ganeti/Config.hs b/src/Ganeti/Config.hs index 9e11611..fa9d183 100644 --- a/src/Ganeti/Config.hs +++ b/src/Ganeti/Config.hs @@ -174,7 +174,7 @@ getNodeInstances cfg nname = let all_insts = M.elems . fromContainer . configInstances $ cfg all_disks = fromContainer . configDisks $ cfg - pri_inst = filter ((== Just nname) . instPrimaryNode) $ all_insts + pri_inst = filter ((== Just nname) . instPrimaryNode) all_insts find_disk :: String -> Maybe Disk find_disk d_uuid = M.lookup (UTF8.fromString d_uuid) all_disks diff --git a/src/Ganeti/JQScheduler.hs b/src/Ganeti/JQScheduler.hs index df6fefc..73c0f6b 100644 --- a/src/Ganeti/JQScheduler.hs +++ b/src/Ganeti/JQScheduler.hs @@ -134,7 +134,7 @@ unreadJob job = JobWithStat {jJob=job, jStat=nullFStat, jINotify=Nothing} -- | Reload interval for polling the running jobs for updates in microseconds. watchInterval :: Int -watchInterval = C.luxidJobqueuePollInterval * 1000000 +watchInterval = C.luxidJobqueuePollInterval * 1000000 -- | Read a cluster parameter from the configuration, using a default if the -- configuration is not available. @@ -440,7 +440,7 @@ scheduleSomeJobs qstate = do showQueue :: Queue -> String showQueue (Queue {qEnqueued=waiting, qRunning=running}) = let showids = show . map (fromJobId . qjId . jJob) - in "Waiting jobs: " ++ showids waiting + in "Waiting jobs: " ++ showids waiting ++ "; running jobs: " ++ showids running -- | Check if a job died, and clean up if so. Return True, if @@ -604,6 +604,7 @@ setJobPriority state jid prio = runResultT $ do -- | Given old and new configs, determines if the changes between them should -- trigger the scheduler to run. +{-# ANN configChangeNeedsRescheduling "HLint: ignore Use ||" #-} configChangeNeedsRescheduling :: ConfigData -> ConfigData -> Bool configChangeNeedsRescheduling oldConfig newConfig = or -- Trigger rescheduling if: diff --git a/src/Ganeti/Rpc.hs b/src/Ganeti/Rpc.hs index ddd947c..103bde2 100644 --- a/src/Ganeti/Rpc.hs +++ b/src/Ganeti/Rpc.hs @@ -345,7 +345,7 @@ instance J.JSON Compressed where -- zlib compress and Base64 encode the data but only if it's long enough showJSON = J.showJSON . (\x -> - if (BL.length $ BL.take 4096 x) < 4096 then + if BL.length (BL.take 4096 x) < 4096 then (C.rpcEncodingNone, x) else (C.rpcEncodingZlibBase64, Base64.encode . compressZlib $ x) -- 2.8.1
