diff --git a/daemons/ganeti-confd b/daemons/ganeti-confd index 27b11a47761af8a0e6abddbd2ae723abf2a177a5..eb91f8b76e54cab9c82122eae6a245c9fc908f61 100755 --- a/daemons/ganeti-confd +++ b/daemons/ganeti-confd @@ -325,7 +325,7 @@ class ConfdConfigurationReloader(object): self._ResetTimer() -def CheckConfd(options, args): +def CheckConfd(_, args): """Initial checks whether to run exit with a failure. """ @@ -340,7 +340,7 @@ def CheckConfd(options, args): sys.exit(constants.EXIT_FAILURE) -def ExecConfd(options, args): +def ExecConfd(options, _): """Main confd function, executed with PID file held """ @@ -354,7 +354,7 @@ def ExecConfd(options, args): # If enabling the processor has failed, we can still go on, but confd will # be disabled logging.warning("Confd is starting in disabled mode") - pass + server = ConfdAsyncUDPServer(options.bind_address, options.port, processor) # Configuration reloader diff --git a/daemons/ganeti-masterd b/daemons/ganeti-masterd index 81becca22f70e2cd0117126661f5ec66c16516df..4d783a83db2621f57edd8ad7ee14938f069cff23 100755 --- a/daemons/ganeti-masterd +++ b/daemons/ganeti-masterd @@ -568,7 +568,7 @@ def CheckMasterd(options, args): sys.exit(constants.EXIT_FAILURE) -def ExecMasterd (options, args): +def ExecMasterd (options, args): # pylint: disable-msg=W0613 """Main master daemon function, executed with the PID file held. """ diff --git a/daemons/ganeti-noded b/daemons/ganeti-noded index 9aa71870c3f581b87ae7694bdc34d4cd766016b8..7a17e4f9ebb92fcf3bd61fd07506742a510b6913 100755 --- a/daemons/ganeti-noded +++ b/daemons/ganeti-noded @@ -71,12 +71,15 @@ def _RequireJobQueueLock(fn): return wrapper -class NodeHttpServer(http.server.HttpServer): # pylint: disable-msg=R0904 +class NodeHttpServer(http.server.HttpServer): """The server implementation. This class holds all methods exposed over the RPC interface. """ + # too many public methods, and unused args - all methods get params + # due to the API + # pylint: disable-msg=R0904,W0613 def __init__(self, *args, **kwargs): http.server.HttpServer.__init__(self, *args, **kwargs) self.noded_pid = os.getpid() @@ -797,7 +800,7 @@ def CheckNoded(_, args): sys.exit(constants.EXIT_FAILURE) -def ExecNoded(options, args): +def ExecNoded(options, _): """Main node daemon function, executed with the PID file held. """ diff --git a/daemons/ganeti-rapi b/daemons/ganeti-rapi index 8fd5265b4135b62470c04dd110c3f88a06f1813e..adbff4c64ca0e881275251586410977e5b7694f8 100755 --- a/daemons/ganeti-rapi +++ b/daemons/ganeti-rapi @@ -195,7 +195,7 @@ def CheckRapi(options, args): ssconf.CheckMaster(options.debug) -def ExecRapi(options, args): +def ExecRapi(options, _): """Main remote API function, executed with the PID file held. """ diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 7913dc4cf9d383faa20c025ce044c9a4491a3e81..3bb6e1a2476c1ce5ed6fd4bdc4e470a8585155df 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -261,8 +261,6 @@ class LogicalUnit(object): """ raise NotImplementedError - # this is valid in this entire class even if added here - # pylint: disable-msg=R0201 def HooksCallBack(self, phase, hook_results, feedback_fn, lu_result): """Notify the LU about the results of its hooks. @@ -282,6 +280,9 @@ class LogicalUnit(object): and hook results """ + # API must be kept, thus we ignore the unused argument and could + # be a function warnings + # pylint: disable-msg=W0613,R0201 return lu_result def _ExpandAndLockInstance(self): diff --git a/lib/confd/querylib.py b/lib/confd/querylib.py index 7dd474c17c251c2f2a0c2e656ca6bea2360dc8e7..e1e323fd9cf86eb0acc1110b8bb0e6080b4ba328 100644 --- a/lib/confd/querylib.py +++ b/lib/confd/querylib.py @@ -50,7 +50,7 @@ class ConfdQuery(object): """ self.reader = reader - def Exec(self, query): # pylint: disable-msg=R0201 + def Exec(self, query): # pylint: disable-msg=R0201,W0613 """Process a single UDP request from a client. Different queries should override this function, which by defaults returns diff --git a/lib/http/__init__.py b/lib/http/__init__.py index d00aba48fe1c3cd5cc1b7ee8c4be8d47b9d1dcbc..6f0d95cedcccab840ff848492f749f5f648621cb 100644 --- a/lib/http/__init__.py +++ b/lib/http/__init__.py @@ -640,6 +640,8 @@ class HttpBase(object): we do on our side. """ + # some parameters are unused, but this is the API + # pylint: disable-msg=W0613 assert self._ssl_params, "SSL not initialized" return (self._ssl_cert.digest("sha1") == cert.digest("sha1") and diff --git a/lib/http/auth.py b/lib/http/auth.py index 15fa986a0513f9a91bd8f049afb7a424cbcd33b1..a13c60f5d05849761f05c54abdd5fb0af416d47d 100644 --- a/lib/http/auth.py +++ b/lib/http/auth.py @@ -97,6 +97,9 @@ class HttpServerRequestAuthentication(object): @return: Authentication realm """ + # today we don't have per-request filtering, but we might want to + # add it in the future + # pylint: disable-msg=W0613 return self.AUTH_REALM def PreHandleRequest(self, req): diff --git a/lib/jqueue.py b/lib/jqueue.py index 6e576b0016677ac81bb0fb7ad4387ca1b007893a..2c2345baa470a94e1cdbddb6c4b4fd323e5bd4f7 100644 --- a/lib/jqueue.py +++ b/lib/jqueue.py @@ -923,6 +923,7 @@ class JobQueue(object): @return: the list of job IDs """ + # pylint: disable-msg=W0613 jlist = [self._ExtractJobID(name) for name in self._ListJobFiles()] jlist = utils.NiceSort(jlist) return jlist diff --git a/lib/rapi/baserlib.py b/lib/rapi/baserlib.py index 286ec7d2e0cae7864b187f6d168a54b6433dee55..020d7bcba06057c73c849c46bb09b3a055f08178 100644 --- a/lib/rapi/baserlib.py +++ b/lib/rapi/baserlib.py @@ -201,12 +201,14 @@ def GetClient(): raise http.HttpBadGateway("Master seems to unreachable: %s" % str(err)) -def FeedbackFn(ts, log_type, log_msg): +def FeedbackFn(ts, log_type, log_msg): # pylint: disable-msg=W0613 """Feedback logging function for http case. We don't have a stdout for printing log messages, so log them to the http log at least. + @param ts: the timestamp (unused) + """ logging.info("%s: %s", log_type, log_msg) diff --git a/lib/utils.py b/lib/utils.py index c8ac96aa2f34cad59cf4e0dc1aaa86a15ec067db..97c28e23ebc616446d4d0251ca02953fd7fa8fe7 100644 --- a/lib/utils.py +++ b/lib/utils.py @@ -2409,7 +2409,8 @@ class SignalHandler(object): """ self.called = False - def _HandleSignal(self, signum, frame): + # we don't care about arguments, but we leave them named for the future + def _HandleSignal(self, signum, frame): # pylint: disable-msg=W0613 """Actual signal handling function. """ diff --git a/scripts/gnt-backup b/scripts/gnt-backup index 2890ecb1116cc497c68710283af68a7b303e9989..6593aa5675185e88383f99eba33621231efcffad 100755 --- a/scripts/gnt-backup +++ b/scripts/gnt-backup @@ -20,8 +20,9 @@ """Backup related commands""" -# pylint: disable-msg=W0401,W0614,C0103 +# pylint: disable-msg=W0401,W0613,W0614,C0103 # W0401: Wildcard import ganeti.cli +# W0613: Unused argument, since all functions follow the same API # W0614: Unused import %s from wildcard import (since we need cli) # C0103: Invalid name gnt-backup diff --git a/scripts/gnt-cluster b/scripts/gnt-cluster index fc978948e33558c8b9f765778956364fb4ed2cdd..53bea1a2c25cdb2d3f82cb83bfaeb6aedd1e7fb8 100755 --- a/scripts/gnt-cluster +++ b/scripts/gnt-cluster @@ -20,8 +20,9 @@ """Cluster related commands""" -# pylint: disable-msg=W0401,W0614,C0103 +# pylint: disable-msg=W0401,W0613,W0614,C0103 # W0401: Wildcard import ganeti.cli +# W0613: Unused argument, since all functions follow the same API # W0614: Unused import %s from wildcard import (since we need cli) # C0103: Invalid name gnt-cluster diff --git a/scripts/gnt-job b/scripts/gnt-job index f377478cb196519b559811387d88ba45bbac774b..2e63cf6de2c91eebc74199a2eeaeae8f6b48f4cf 100755 --- a/scripts/gnt-job +++ b/scripts/gnt-job @@ -20,8 +20,9 @@ """Job related commands""" -# pylint: disable-msg=W0401,W0614,C0103 +# pylint: disable-msg=W0401,W0613,W0614,C0103 # W0401: Wildcard import ganeti.cli +# W0613: Unused argument, since all functions follow the same API # W0614: Unused import %s from wildcard import (since we need cli) # C0103: Invalid name gnt-job diff --git a/scripts/gnt-node b/scripts/gnt-node index b639b58aca3b43739badb11883ac2e5d94c0fda5..f2a13ff85c9980d83e50e76881a1c07353156e57 100755 --- a/scripts/gnt-node +++ b/scripts/gnt-node @@ -20,8 +20,9 @@ """Node related commands""" -# pylint: disable-msg=W0401,W0614,C0103 +# pylint: disable-msg=W0401,W0613,W0614,C0103 # W0401: Wildcard import ganeti.cli +# W0613: Unused argument, since all functions follow the same API # W0614: Unused import %s from wildcard import (since we need cli) # C0103: Invalid name gnt-node diff --git a/scripts/gnt-os b/scripts/gnt-os index 40bea5516dc96a3331689fc3958667d5241e8db3..53304e2da8cf1073756f00ed5664b47306e09c4d 100755 --- a/scripts/gnt-os +++ b/scripts/gnt-os @@ -20,8 +20,9 @@ """OS scripts related commands""" -# pylint: disable-msg=W0401,W0614,C0103 +# pylint: disable-msg=W0401,W0613,W0614,C0103 # W0401: Wildcard import ganeti.cli +# W0613: Unused argument, since all functions follow the same API # W0614: Unused import %s from wildcard import (since we need cli) # C0103: Invalid name gnt-os diff --git a/tools/burnin b/tools/burnin index 8adad917ab2e8b8261af9c6e0cc80a02828aded8..f0e4113a9ad6db39fdbe07da5797ca9a02195e69 100755 --- a/tools/burnin +++ b/tools/burnin @@ -87,6 +87,8 @@ class SimpleOpener(urllib.FancyURLopener): def prompt_user_passwd(self, host, realm, clear_cache=0): """No-interaction version of prompt_user_passwd.""" + # we follow parent class' API + # pylint: disable-msg=W0613 return None, None def http_error_default(self, url, fp, errcode, errmsg, headers): diff --git a/tools/cfgshell b/tools/cfgshell index 62e501df1580a3705d19a34baa305a1df50ba777..57ed0bd7f51a70a4812af8d10cf8e1fbc4b49880 100755 --- a/tools/cfgshell +++ b/tools/cfgshell @@ -53,6 +53,8 @@ class ConfigShell(cmd.Cmd): responsibility to know what they're doing. """ + # all do_/complete_* functions follow the same API + # pylint: disable-msg=W0613 prompt = "(/) " def __init__(self, cfg_file=None):