diff --git a/conf/stack.ini b/conf/stack.ini index c9dc591d..939c9244 100644 --- a/conf/stack.ini +++ b/conf/stack.ini @@ -34,7 +34,7 @@ rabbit_host = ${RABBIT_HOST:-$(host:ip)} # Sys log enabled or not syslog = 0 -# Which run type to use [fork, upstart (WIP)] +# Which run type to use [fork, upstart (WIP), screen (?)] run_type = fork # These flags are used for starting components under upstart diff --git a/devstack/component.py b/devstack/component.py index 3be29bcf..59b63837 100644 --- a/devstack/component.py +++ b/devstack/component.py @@ -352,7 +352,7 @@ class ProgramRuntime(ComponentBase): def __init__(self, component_name, *args, **kargs): ComponentBase.__init__(self, component_name, *args, **kargs) - self.run_type = self.cfg.getdefaulted("default", "run_type", settings.RUN_TYPE_DEF) + self.run_type = utils.fetch_run_type(self.cfg) if self.run_type not in settings.RUN_TYPES_KNOWN: msg = "Unknown run type %s found in config default/run_type" % (self.run_type) raise excp.ConfigException(msg) diff --git a/devstack/components/nova.py b/devstack/components/nova.py index 40ded503..4baf13ed 100644 --- a/devstack/components/nova.py +++ b/devstack/components/nova.py @@ -268,7 +268,7 @@ class NovaInstaller(comp.PythonInstallComponent): self.xvnc_enabled = False if not self.component_opts or NXVNC in self.component_opts: self.xvnc_enabled = True - self.run_type = self.cfg.getdefaulted("default", "run_type", settings.RUN_TYPE_DEF) + self.run_type = utils.fetch_run_type(self.cfg) self.upstart_on = False if self.run_type == settings.RUN_TYPE_UPSTART: self.upstart_on = True diff --git a/devstack/settings.py b/devstack/settings.py index aec6f274..8c775b72 100644 --- a/devstack/settings.py +++ b/devstack/settings.py @@ -91,8 +91,8 @@ COMPONENT_DEPENDENCIES = { } # Different run types supported -RUN_TYPE_FORK = "fork" -RUN_TYPE_UPSTART = "upstart" +RUN_TYPE_FORK = "FORK" +RUN_TYPE_UPSTART = "UPSTART" RUN_TYPE_DEF = RUN_TYPE_FORK RUN_TYPES_KNOWN = [RUN_TYPE_UPSTART, RUN_TYPE_FORK, RUN_TYPE_DEF] diff --git a/devstack/utils.py b/devstack/utils.py index 596fc7fd..e11b1dc4 100644 --- a/devstack/utils.py +++ b/devstack/utils.py @@ -158,6 +158,12 @@ def get_host_ip(): return ip +def fetch_run_type(config): + run_type = config.getdefaulted("default", "run_type", settings.RUN_TYPE_DEF) + run_type = run_type.upper() + return run_type + + def is_interface(intfc): if intfc in get_interfaces(): return True