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 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,