self._ResetTimer()
-def CheckConfd(options, args):
+def CheckConfd(_, args):
"""Initial checks whether to run exit with a failure.
"""
sys.exit(constants.EXIT_FAILURE)
-def ExecConfd(options, args):
+def ExecConfd(options, _):
"""Main confd function, executed with PID file held
"""
# 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
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.
"""
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()
sys.exit(constants.EXIT_FAILURE)
-def ExecNoded(options, args):
+def ExecNoded(options, _):
"""Main node daemon function, executed with the PID file held.
"""
ssconf.CheckMaster(options.debug)
-def ExecRapi(options, args):
+def ExecRapi(options, _):
"""Main remote API function, executed with the PID file held.
"""
"""
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.
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):
"""
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
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
@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):
@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
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)
"""
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.
"""
"""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
"""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
"""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
"""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
"""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
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):
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):