Commit fd346851 authored by René Nussbaumer's avatar René Nussbaumer
Browse files

Remove utils.EnsureDir as this is done by ensure-dirs.in now


Signed-off-by: default avatarRené Nussbaumer <rn@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent e60c73a1
......@@ -293,9 +293,7 @@ def main():
version="%%prog (ganeti) %s" %
constants.RELEASE_VERSION)
dirs = [(val, constants.RUN_DIRS_MODE) for val in constants.SUB_RUN_DIRS]
dirs.append((constants.LOCK_DIR, 1777))
daemon.GenericMain(constants.CONFD, parser, dirs, CheckConfd, ExecConfd)
daemon.GenericMain(constants.CONFD, parser, CheckConfd, ExecConfd)
if __name__ == "__main__":
......
......@@ -565,11 +565,7 @@ def main():
parser.add_option("--yes-do-it", dest="yes_do_it",
help="Override interactive check for --no-voting",
default=False, action="store_true")
dirs = [(constants.RUN_GANETI_DIR, constants.RUN_DIRS_MODE),
(constants.SOCKET_DIR, constants.SOCKET_DIR_MODE),
]
daemon.GenericMain(constants.MASTERD, parser, dirs,
CheckMasterd, ExecMasterd,
daemon.GenericMain(constants.MASTERD, parser, CheckMasterd, ExecMasterd,
multithreaded=True)
......
......@@ -965,12 +965,7 @@ def main():
help="Do not mlock the node memory in ram",
default=True, action="store_false")
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))
dirs.append((constants.CRYPTO_KEYS_DIR, constants.CRYPTO_KEYS_DIR_MODE))
dirs.append((constants.IMPORT_EXPORT_DIR, constants.IMPORT_EXPORT_DIR_MODE))
daemon.GenericMain(constants.NODED, parser, dirs, CheckNoded, ExecNoded,
daemon.GenericMain(constants.NODED, parser, CheckNoded, ExecNoded,
default_ssl_cert=constants.NODED_CERT_FILE,
default_ssl_key=constants.NODED_CERT_FILE,
console_logging=True)
......
......@@ -249,9 +249,7 @@ def main():
usage="%prog [-f] [-d] [-p port] [-b ADDRESS]",
version="%%prog (ganeti) %s" % constants.RELEASE_VERSION)
dirs = [(val, constants.RUN_DIRS_MODE) for val in constants.SUB_RUN_DIRS]
dirs.append((constants.LOG_OS_DIR, 0750))
daemon.GenericMain(constants.RAPI, parser, dirs, CheckRapi, ExecRapi,
daemon.GenericMain(constants.RAPI, parser, CheckRapi, ExecRapi,
default_ssl_cert=constants.RAPI_CERT_FILE,
default_ssl_key=constants.RAPI_CERT_FILE)
......
......@@ -487,7 +487,7 @@ class Mainloop(object):
self._signal_wait.append(owner)
def GenericMain(daemon_name, optionparser, dirs, check_fn, exec_fn,
def GenericMain(daemon_name, optionparser, check_fn, exec_fn,
multithreaded=False, console_logging=False,
default_ssl_cert=None, default_ssl_key=None):
"""Shared main function for daemons.
......@@ -497,9 +497,6 @@ def GenericMain(daemon_name, optionparser, dirs, check_fn, exec_fn,
@type optionparser: optparse.OptionParser
@param optionparser: initialized optionparser with daemon-specific options
(common -f -d options will be handled by this module)
@type dirs: list of (string, integer)
@param dirs: list of directories that must be created if they don't exist,
and the permissions to be used to create them
@type check_fn: function which accepts (options, args)
@param check_fn: function that checks start conditions and exits if they're
not met
......@@ -588,8 +585,6 @@ def GenericMain(daemon_name, optionparser, dirs, check_fn, exec_fn,
if check_fn is not None:
check_fn(options, args)
utils.EnsureDirs(dirs)
if options.fork:
utils.CloseFDs()
utils.Daemonize(logfile=constants.DAEMONS_LOGFILES[daemon_name])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment