Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

Commit

Permalink
Flatten: improve error handling
Browse files Browse the repository at this point in the history
Flatten provides also information about invalid manifests, so we cannot
handle output of flatten as server error only.

Now OMPS check exception raised from flatten to provide more accurate
error.

Signed-off-by: Martin Bašti <mbasti@redhat.com>
  • Loading branch information
MartinBasti committed Jul 11, 2019
1 parent 42525e5 commit 41166cf
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions omps/api/v1/push.py
Expand Up @@ -25,7 +25,7 @@
OMPSUploadedFileError,
OMPSExpectedFileError,
QuayPackageNotFound,
QuayCourierError,
raise_for_courier_exception,
)
from omps.greenwave import GREENWAVE
from omps.koji_util import KOJI
Expand Down Expand Up @@ -178,9 +178,7 @@ def _flatten_manifest_structure(source_dir, dest_dir):
try:
flatten(source_dir, dest_dir)
except OpCourierError as e:
raise QuayCourierError(
'Failed to flatten manifest directory: {}'.format(e)
)
raise_for_courier_exception(e)

if not os.listdir(dest_dir):
# if dest dir is empty, it means that flatten did noop and source dir
Expand Down

0 comments on commit 41166cf

Please sign in to comment.