From c6a3f103ffc84aecca13ff2cc47274cbfdd464c1 Mon Sep 17 00:00:00 2001 From: Ekaterina Fedorova Date: Tue, 22 Oct 2013 15:40:46 +0400 Subject: [PATCH] Fix bugs 1) Handle hash_sum = None situation 2) Add workflows to horizon archive Change-Id: Ie44e43bdabab239fbdfdcaae90c533f663041dd3 --- muranorepository/api/v1.py | 2 +- muranorepository/utils/archiver.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/muranorepository/api/v1.py b/muranorepository/api/v1.py index adaf7a5..70339bb 100644 --- a/muranorepository/api/v1.py +++ b/muranorepository/api/v1.py @@ -37,7 +37,7 @@ def _get_archive(client, hash_sum): manifests = parser.parse() types = None if client == 'conductor': - types = ('heat', 'agent', 'scripts') + types = ('heat', 'agent', 'scripts', 'workflows') elif client == 'ui': types = ('ui',) else: diff --git a/muranorepository/utils/archiver.py b/muranorepository/utils/archiver.py index 224b5a6..89ecd42 100644 --- a/muranorepository/utils/archiver.py +++ b/muranorepository/utils/archiver.py @@ -82,6 +82,11 @@ class Archiver(object): return os.path.abspath(os.path.join(pkg_dir, ARCHIVE_PKG_NAME)) def _is_data_cached(self, cache_dir, hash_sum): + #ToDo: optimize archive creation: use existing cached version of + # archive package when no hash sum is provided by client + if not hash_sum: + log.warning('Hash parameter was not found in request') + return False existing_caches = os.listdir(cache_dir) if len(existing_caches) == 1: if existing_caches[0] == hash_sum: