delete_old_oci_images: fix the module fail format

Signed-off-by: Clement Verna <cverna@tutanota.com>
This commit is contained in:
Clement Verna 2019-06-04 13:08:02 +02:00
parent 8241b508ec
commit 6760916870

View file

@ -100,9 +100,10 @@ def main():
# Get the list of repositories in the registry (Assume we have less than 500)
resp = s.get("{}/v2/_catalog?n=500".format(registry))
if not resp.ok:
result["stdout_lines"].append("Failed to get the list of images on the {}".format(registry))
result["failed"] = True
module.fail_json(**result)
module.fail_json(
msg="Failed to get the list of images on the {}".format(registry)",
failed=True
)
repositories = resp.json().get("repositories")