diff --git a/devstack/component.py b/devstack/component.py index b4140a60..104f84e1 100644 --- a/devstack/component.py +++ b/devstack/component.py @@ -95,11 +95,11 @@ class PkgInstallComponent(ComponentBase): locations = self._get_download_locations() base_dir = self.appdir for location_info in locations: - uri_tuple = location_info.get("uri") + uri_tuple = location_info.get["uri"] branch_tuple = location_info.get("branch") subdir = location_info.get("subdir") target_loc = None - if subdir and len(subdir): + if subdir: target_loc = sh.joinpths(base_dir, subdir) else: target_loc = base_dir @@ -109,7 +109,6 @@ class PkgInstallComponent(ComponentBase): uri = self.cfg.get(uri_tuple[0], uri_tuple[1]) self.tracewriter.downloaded(target_loc, uri) self.tracewriter.dir_made(*down.download(target_loc, uri, branch)) - self.tracewriter.downloaded(target_loc, uri) return len(locations) def _get_param_map(self, config_fn): @@ -343,7 +342,9 @@ class PkgUninstallComponent(ComponentBase): dirsmade = self.tracereader.dirs_made() if dirsmade: if self.keep_old: - dirsmade = sh.remove_parents(self.appdir, dirsmade) + downloads = self.tracereader.downloaded() + for info in downloads: + dirsmade = sh.remove_parents(info['target'], dirsmade) for dirname in dirsmade: LOG.info("Removing created directory (%s)" % (dirname)) sh.deldir(dirname, run_as_root=True) diff --git a/devstack/settings.py b/devstack/settings.py index eb6fe5a4..1c074208 100644 --- a/devstack/settings.py +++ b/devstack/settings.py @@ -79,6 +79,7 @@ COMPONENT_DEPENDENCIES = { NOVA: [KEYSTONE, GLANCE, DB, RABBIT, NOVA_CLIENT], SWIFT: [KEYSTONE_CLIENT], NOVA_CLIENT: [], + # Horizon depends on glances client (which should really be a client package) HORIZON: [KEYSTONE_CLIENT, GLANCE, NOVA_CLIENT, QUANTUM_CLIENT], # More of quantums deps come from its module function get_dependencies QUANTUM: [], diff --git a/devstack/trace.py b/devstack/trace.py index dd72dfff..f9c4eab8 100644 --- a/devstack/trace.py +++ b/devstack/trace.py @@ -178,6 +178,16 @@ class TraceReader(object): def exists(self): return sh.exists(self.trace_fn) + def downloaded(self): + lines = self._read() + locs = list() + for (cmd, action) in lines: + if cmd == DOWNLOADED and len(action): + jentry = json.loads(action) + if type(jentry) is dict: + locs.append(jentry) + return locs + def py_listing(self): return self._readpy()