diff --git a/roles/upload-logs-base/library/zuul_s3_upload.py b/roles/upload-logs-base/library/zuul_s3_upload.py index 76ae2344c..89e383b20 100755 --- a/roles/upload-logs-base/library/zuul_s3_upload.py +++ b/roles/upload-logs-base/library/zuul_s3_upload.py @@ -31,6 +31,7 @@ Run this from the CLI from the zuul-jobs/roles directory with: import argparse import logging import os +import pprint try: import queue as queuelib except ImportError: @@ -263,7 +264,9 @@ def ansible_main(): aws_access_key=p.get('aws_access_key'), aws_secret_key=p.get('aws_secret_key')) if failures: - module.fail_json(changed=True, + failure_msg = pprint.pformat(failures) + module.fail_json(msg=f"Failure(s) during log upload:\n{failure_msg}", + changed=True, url=url, failures=failures) module.exit_json(changed=True,