From f6a5c2c2486f1795c43a91f35fc067351a4f1ff5 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Wed, 29 Feb 2012 13:40:59 -0800 Subject: [PATCH] More horizon fixups + download regex change. --- devstack/component.py | 5 ++++- devstack/components/horizon.py | 14 +++++++------- devstack/downloader.py | 6 +++--- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/devstack/component.py b/devstack/component.py index 68f1f415..d4835019 100644 --- a/devstack/component.py +++ b/devstack/component.py @@ -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) diff --git a/devstack/components/horizon.py b/devstack/components/horizon.py index 11ec5f69..9bc87b76 100644 --- a/devstack/components/horizon.py +++ b/devstack/components/horizon.py @@ -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) diff --git a/devstack/downloader.py b/devstack/downloader.py index 66083383..8907b0a9 100644 --- a/devstack/downloader.py +++ b/devstack/downloader.py @@ -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)