Add the config to the environment index for debugging
Project: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/commit/c0480088 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/tree/c0480088 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/diff/c0480088 Branch: refs/heads/master Commit: c04800889b24435d2e5d07d9894fa33381d97cdd Parents: 127fb83 Author: James Peach <[email protected]> Authored: Tue Mar 3 20:53:02 2015 -0800 Committer: James Peach <[email protected]> Committed: Tue Mar 3 20:54:54 2015 -0800 ---------------------------------------------------------------------- tsqa/environment.py | 7 +++++-- tsqa/utils.py | 7 ++++--- 2 files changed, 9 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver-qa/blob/c0480088/tsqa/environment.py ---------------------------------------------------------------------- diff --git a/tsqa/environment.py b/tsqa/environment.py index 4a01e01..d170814 100644 --- a/tsqa/environment.py +++ b/tsqa/environment.py @@ -179,13 +179,16 @@ class EnvironmentFactory(object): shutil.rmtree(builddir) # delete builddir, not useful after install # stash the env - self.environment_stash[key] = installdir + self.environment_stash[key] = { + 'path': installdir, + 'configuration': args + } except Exception as e: EnvironmentFactory.negative_cache[key] = e raise # create a layout - layout = Layout(self.environment_stash[key]) + layout = Layout(self.environment_stash[key]['path']) # return an environment cloned from that layout ret = Environment() http://git-wip-us.apache.org/repos/asf/trafficserver-qa/blob/c0480088/tsqa/utils.py ---------------------------------------------------------------------- diff --git a/tsqa/utils.py b/tsqa/utils.py index 81efdb0..3224a4d 100644 --- a/tsqa/utils.py +++ b/tsqa/utils.py @@ -188,15 +188,16 @@ class BuildCache(MutableMapping): try: with open(self.cache_map_file) as fh: cache = json.load(fh) - except IOError: + except IOError, ValueError: + # Just bail if the file is not there, is empty, or does not parse. return changed = False # whether we changed the cache file, and need to write it out # verify that all of those directories exist, clean them out if they don't for source_hash, env_map in cache.items(): # if the directory doesn't exist - for key, path in env_map.items(): - if not os.path.isdir(path): + for key, entry in env_map.items(): + if not os.path.isdir(entry['path']): del cache[source_hash][key] changed = True # if the source_hash level key is now empty
