Merge "Supply missing error message on S3 upload failure"

This commit is contained in:
Zuul 2022-08-14 22:33:08 +00:00 committed by Gerrit Code Review
commit 357e6fa6f9

View File

@ -31,6 +31,7 @@ Run this from the CLI from the zuul-jobs/roles directory with:
import argparse import argparse
import logging import logging
import os import os
import pprint
try: try:
import queue as queuelib import queue as queuelib
except ImportError: except ImportError:
@ -263,7 +264,9 @@ def ansible_main():
aws_access_key=p.get('aws_access_key'), aws_access_key=p.get('aws_access_key'),
aws_secret_key=p.get('aws_secret_key')) aws_secret_key=p.get('aws_secret_key'))
if failures: 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, url=url,
failures=failures) failures=failures)
module.exit_json(changed=True, module.exit_json(changed=True,