from ganeti import constants
from ganeti import errors
from ganeti import daemon
-from ganeti import ssconf
class ConfdAsyncUDPServer(daemon.AsyncUDPSocket):
@param filename: config file to watch
"""
+ # pylint: disable-msg=W0231
# no need to call the parent's constructor
self.watch_manager = watch_manager
self.callback = callback
self._ResetTimer()
-def CheckConfd(options, args):
+def CheckConfd(_, args):
"""Initial checks whether to run exit with a failure.
"""
+ if args: # confd doesn't take any arguments
+ print >> sys.stderr, ("Usage: %s [-f] [-d] [-b ADDRESS]" % sys.argv[0])
+ sys.exit(constants.EXIT_FAILURE)
+
# TODO: collapse HMAC daemons handling in daemons GenericMain, when we'll
# have more than one.
if not os.path.isfile(constants.HMAC_CLUSTER_KEY):
sys.exit(constants.EXIT_FAILURE)
-def ExecConfd(options, args):
+def ExecConfd(options, _):
"""Main confd function, executed with PID file held
"""
+ # TODO: clarify how the server and reloader variables work (they are
+ # not used)
+ # pylint: disable-msg=W0612
mainloop = daemon.Mainloop()
# Asyncronous confd UDP server
# 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