Updating run time so utils extracts it (and canon's it).

This commit is contained in:
Joshua Harlow 2012-02-17 17:44:10 -08:00
parent 8d7c53953c
commit d8db0af79e
5 changed files with 11 additions and 5 deletions

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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]

View File

@ -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