Skip to content

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 3, 2019
1 parent 42525e5 commit 08636c9
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 08636c9

Please sign in to comment.