Remove superfluous warnings in HooksRunner
[ganeti-local] / daemons / ganeti-confd
index de12700..d19bfad 100755 (executable)
@@ -48,7 +48,6 @@ from ganeti.confd import server as confd_server
 from ganeti import constants
 from ganeti import errors
 from ganeti import daemon
-from ganeti import ssconf
 
 
 class ConfdAsyncUDPServer(daemon.AsyncUDPSocket):
@@ -103,6 +102,7 @@ class ConfdInotifyEventHandler(pyinotify.ProcessEvent):
     @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
@@ -325,10 +325,14 @@ class ConfdConfigurationReloader(object):
     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):
@@ -336,10 +340,13 @@ def CheckConfd(options, args):
     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
@@ -350,7 +357,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