"""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):
"""Initial checks whether to run or exit with a failure.
"""
+ if args: # masterd doesn't take any arguments
+ print >> sys.stderr, ("Usage: %s [-f] [-d]" % sys.argv[0])
+ sys.exit(constants.EXIT_FAILURE)
+
ssconf.CheckMaster(options.debug)
# If CheckMaster didn't fail we believe we are the master, but we have to
return backend.ValidateHVParams(hvname, hvparams)
+def CheckNoded(_, args):
+ """Initial checks whether to run or exit with a failure.
+
+ """
+ if args: # noded doesn't take any arguments
+ print >> sys.stderr, ("Usage: %s [-f] [-d] [-p port] [-b ADDRESS]" %
+ sys.argv[0])
+ sys.exit(constants.EXIT_FAILURE)
+
+
def ExecNoded(options, args):
"""Main node daemon function, executed with the PID file held.
dirs = [(val, constants.RUN_DIRS_MODE) for val in constants.SUB_RUN_DIRS]
dirs.append((constants.LOG_OS_DIR, 0750))
dirs.append((constants.LOCK_DIR, 1777))
- daemon.GenericMain(constants.NODED, parser, dirs, None, ExecNoded)
+ daemon.GenericMain(constants.NODED, parser, dirs, CheckNoded, ExecNoded)
if __name__ == '__main__':
"""Initial checks whether to run or exit with a failure.
"""
- if len(args) != 0:
- print >> sys.stderr, "Usage: %s [-f] [-d] [-p port] [-b ADDRESS]" % \
- sys.argv[0]
+ if args: # rapi doesn't take any arguments
+ print >> sys.stderr, ("Usage: %s [-f] [-d] [-p port] [-b ADDRESS]" %
+ sys.argv[0])
sys.exit(constants.EXIT_FAILURE)
ssconf.CheckMaster(options.debug)
"""
global client # pylint: disable-msg=W0603
- options, _ = ParseOptions()
+ options, args = ParseOptions()
+
+ if args: # watcher doesn't take any arguments
+ print >> sys.stderr, ("Usage: %s [-f] " % sys.argv[0])
+ sys.exit(constants.EXIT_FAILURE)
utils.SetupLogging(constants.LOG_WATCHER, debug=options.debug,
stderr_logging=options.debug)