Revision f93427cd
b/daemons/ganeti-confd | ||
---|---|---|
329 | 329 |
"""Initial checks whether to run exit with a failure. |
330 | 330 |
|
331 | 331 |
""" |
332 |
if args: # confd doesn't take any arguments |
|
333 |
print >> sys.stderr, ("Usage: %s [-f] [-d] [-b ADDRESS]" % sys.argv[0]) |
|
334 |
sys.exit(constants.EXIT_FAILURE) |
|
335 |
|
|
332 | 336 |
# TODO: collapse HMAC daemons handling in daemons GenericMain, when we'll |
333 | 337 |
# have more than one. |
334 | 338 |
if not os.path.isfile(constants.HMAC_CLUSTER_KEY): |
b/daemons/ganeti-masterd | ||
---|---|---|
538 | 538 |
"""Initial checks whether to run or exit with a failure. |
539 | 539 |
|
540 | 540 |
""" |
541 |
if args: # masterd doesn't take any arguments |
|
542 |
print >> sys.stderr, ("Usage: %s [-f] [-d]" % sys.argv[0]) |
|
543 |
sys.exit(constants.EXIT_FAILURE) |
|
544 |
|
|
541 | 545 |
ssconf.CheckMaster(options.debug) |
542 | 546 |
|
543 | 547 |
# If CheckMaster didn't fail we believe we are the master, but we have to |
b/daemons/ganeti-noded | ||
---|---|---|
787 | 787 |
return backend.ValidateHVParams(hvname, hvparams) |
788 | 788 |
|
789 | 789 |
|
790 |
def CheckNoded(_, args): |
|
791 |
"""Initial checks whether to run or exit with a failure. |
|
792 |
|
|
793 |
""" |
|
794 |
if args: # noded doesn't take any arguments |
|
795 |
print >> sys.stderr, ("Usage: %s [-f] [-d] [-p port] [-b ADDRESS]" % |
|
796 |
sys.argv[0]) |
|
797 |
sys.exit(constants.EXIT_FAILURE) |
|
798 |
|
|
799 |
|
|
790 | 800 |
def ExecNoded(options, args): |
791 | 801 |
"""Main node daemon function, executed with the PID file held. |
792 | 802 |
|
... | ... | |
824 | 834 |
dirs = [(val, constants.RUN_DIRS_MODE) for val in constants.SUB_RUN_DIRS] |
825 | 835 |
dirs.append((constants.LOG_OS_DIR, 0750)) |
826 | 836 |
dirs.append((constants.LOCK_DIR, 1777)) |
827 |
daemon.GenericMain(constants.NODED, parser, dirs, None, ExecNoded)
|
|
837 |
daemon.GenericMain(constants.NODED, parser, dirs, CheckNoded, ExecNoded)
|
|
828 | 838 |
|
829 | 839 |
|
830 | 840 |
if __name__ == '__main__': |
b/daemons/ganeti-rapi | ||
---|---|---|
187 | 187 |
"""Initial checks whether to run or exit with a failure. |
188 | 188 |
|
189 | 189 |
""" |
190 |
if len(args) != 0:
|
|
191 |
print >> sys.stderr, "Usage: %s [-f] [-d] [-p port] [-b ADDRESS]" % \
|
|
192 |
sys.argv[0]
|
|
190 |
if args: # rapi doesn't take any arguments
|
|
191 |
print >> sys.stderr, ("Usage: %s [-f] [-d] [-p port] [-b ADDRESS]" %
|
|
192 |
sys.argv[0])
|
|
193 | 193 |
sys.exit(constants.EXIT_FAILURE) |
194 | 194 |
|
195 | 195 |
ssconf.CheckMaster(options.debug) |
b/daemons/ganeti-watcher | ||
---|---|---|
470 | 470 |
""" |
471 | 471 |
global client # pylint: disable-msg=W0603 |
472 | 472 |
|
473 |
options, _ = ParseOptions() |
|
473 |
options, args = ParseOptions() |
|
474 |
|
|
475 |
if args: # watcher doesn't take any arguments |
|
476 |
print >> sys.stderr, ("Usage: %s [-f] " % sys.argv[0]) |
|
477 |
sys.exit(constants.EXIT_FAILURE) |
|
474 | 478 |
|
475 | 479 |
utils.SetupLogging(constants.LOG_WATCHER, debug=options.debug, |
476 | 480 |
stderr_logging=options.debug) |
Also available in: Unified diff