More horizon fixups + download regex change.

This commit is contained in:
Joshua Harlow 2012-02-29 13:40:59 -08:00
parent e5fa06494c
commit f6a5c2c248
3 changed files with 14 additions and 11 deletions

View File

@ -403,6 +403,7 @@ class ProgramRuntime(ComponentBase):
# First make a pass and make sure all runtime (e.g. upstart) config files are in place....
cls = RUNNER_CLS_MAPPING[utils.fetch_run_type(self.cfg)]
instance = cls(self.cfg, self.component_name, self.tracedir)
tot_am = 0
for app_info in self._get_apps_to_start():
app_name = app_info["name"]
app_pth = app_info.get("path", app_name)
@ -413,6 +414,8 @@ class ProgramRuntime(ComponentBase):
LOG.info("Configuring runner for program [%s]" % (app_name))
cfg_am = instance.configure(app_name, (app_pth, app_dir, program_opts))
LOG.info("Configured %s files for runner for program [%s]" % (cfg_am, app_name))
tot_am += cfg_am
return tot_am
def start(self):
# Select how we are going to start it
@ -466,7 +469,7 @@ class ProgramRuntime(ComponentBase):
to_kill = self._locate_killers()
for (app_name, killer) in to_kill:
killer.stop(app_name)
LOG.debug("Deleting trace file %s" % (self.starttracereader.trace_fn))
LOG.debug("Deleting start trace file [%s]" % (self.starttracereader.trace_fn))
sh.unlink(self.starttracereader.trace_fn)
return len(to_kill)

View File

@ -175,6 +175,12 @@ class HorizonInstaller(comp.PythonInstallComponent):
def pre_install(self):
comp.PythonInstallComponent.pre_install(self)
self.tracewriter.make_dir(self.log_dir)
if utils.service_enabled(settings.QUANTUM_CLIENT, self.instances, False):
#TODO remove this junk, blah, puke that we have to do this
tgt_dir = sh.joinpths(self.dash_dir, 'quantum')
if sh.isdir(tgt_dir):
#whhhhy???
sh.deldir(tgt_dir)
def _config_fixups(self):
#currently just handling rhel fixups
@ -203,13 +209,7 @@ class HorizonInstaller(comp.PythonInstallComponent):
sh.write_file(httpd_fn, utils.joinlinesep(*new_lines))
def _fix_quantum(self):
if utils.service_enabled(settings.QUANTUM_CLIENT, self.instances, False):
#TODO remove this junk, blah, puke that we have to do this
tgt_dir = sh.joinpths(self.dash_dir, 'quantum')
if sh.isdir(tgt_dir):
#whhhhy???
sh.deldir(tgt_dir)
else:
if not (utils.service_enabled(settings.QUANTUM_CLIENT, self.instances, False)):
#Make the fake quantum
quantum_dir = sh.joinpths(self.dash_dir, 'quantum')
self.tracewriter.make_dir(quantum_dir)

View File

@ -22,7 +22,8 @@ from devstack import log as logging
from devstack import shell as sh
LOG = logging.getLogger("devstack.downloader")
EXT_REG = re.compile(r"^(.*?)\.git\s*$", re.IGNORECASE)
GIT_EXT_REG = re.compile(r"^(.*?)\.git\s*$", re.IGNORECASE)
GIT_MASTER_BRANCH = "master"
CLONE_CMD = ["git", "clone"]
CHECKOUT_CMD = ['git', 'checkout']
@ -52,8 +53,7 @@ def _gitdownload(storewhere, uri, branch=None):
def download(storewhere, uri, branch=None):
#figure out which type
up = urlparse(uri)
if up and up.scheme.lower() == "git" or \
EXT_REG.match(up.path):
if up and up.scheme.lower() == "git" or GIT_EXT_REG.match(up.path):
return _gitdownload(storewhere, uri, branch)
else:
msg = "Currently we do not know how to download from uri [%s]" % (uri)