Browse Source

Merge "Improve error reporting for not_done jobs in buildah"

tags/12.0.0
Zuul 3 weeks ago
parent
commit
5f82d33d55
2 changed files with 16 additions and 6 deletions
  1. +15
    -5
      tripleo_common/image/builder/buildah.py
  2. +1
    -1
      tripleo_common/tests/image/builder/test_buildah.py

+ 15
- 5
tripleo_common/image/builder/buildah.py View File

@@ -186,11 +186,21 @@ class BuildahBuilder(base.BaseBuilder):
raise SystemError(job._exception)
else:
if not_done:
raise SystemError(
'The following jobs were incomplete: {}'.format(
not_done
)
)
error_msg = ('The following jobs were '
'incomplete: {}'.format(not_done))

exceptions_raised = [job._exception for job in not_done
if job._exception]

if exceptions_raised:
error_msg = error_msg + os.linesep + (
"%(raised_count)d of the incomplete "
"jobs threw exceptions: %(exceptions)s" %
{'raised_count': len(exceptions_raised),
'exceptions': exceptions_raised})

raise SystemError(error_msg)

elif isinstance(deps, (dict,)):
for container in deps:
self._generate_container(container)

+ 1
- 1
tripleo_common/tests/image/builder/test_buildah.py View File

@@ -38,7 +38,7 @@ BUILD_ALL_STR_CONTAINER = 'container1'


class ThreadPoolExecutorReturn(object):
pass
_exception = None


class ThreadPoolExecutorReturnFailed(object):

Loading…
Cancel
Save