Handle situation when there is no manifest in uploading archive

Change-Id: I66b1e55561f8a1bfeb7a6475ef36916c22f28cb4
This commit is contained in:
Ekaterina Fedorova 2013-12-12 20:34:07 +04:00
parent f53075cb07
commit c686a87aa2

View File

@ -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