From c686a87aa21cbafd0515aa8a6af31b8b53bcb67e Mon Sep 17 00:00:00 2001 From: Ekaterina Fedorova Date: Thu, 12 Dec 2013 20:34:07 +0400 Subject: [PATCH] Handle situation when there is no manifest in uploading archive Change-Id: I66b1e55561f8a1bfeb7a6475ef36916c22f28cb4 --- muranorepository/utils/archiver.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/muranorepository/utils/archiver.py b/muranorepository/utils/archiver.py index 760bd0d..aca4e88 100644 --- a/muranorepository/utils/archiver.py +++ b/muranorepository/utils/archiver.py @@ -267,9 +267,12 @@ class Archiver(object): # assert manifest file manifests = glob.glob(os.path.join(path_to_extract, '*-manifest.yaml')) + if not manifests: + log.error('There is no manifest file in archive') + return False if len(manifests) != 1: - raise AssertionError('There should be one ' - 'manifest file in archive') + log.error('There are more then one manifest file in archive') + return False shutil.copy(manifests[0], CONF.manifests) #Todo: Check manifest is valid