1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-03-22 02:29:08 +00:00

Loop over image names when multiple images present in archive (#413)

Signed-off-by: Cory Prelerson <cprelerson42@gmail.com>
This commit is contained in:
MasterWaldo 2022-04-24 15:38:53 -04:00 committed by GitHub
parent f1d68c0fbd
commit b51dc5c814
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 1 deletions

View file

@ -155,7 +155,7 @@ def load(module, executable):
if rc != 0:
module.fail_json(msg="Image loading failed: %s" % (err))
image_name_line = [i for i in out.splitlines() if 'Loaded image' in i][0]
image_name = image_name_line.split(":", maxsplit=1)[1].strip()
image_name = image_name_line.split("Loaded image(s): ")[1].split(',')[0].strip()
rc, out2, err2 = module.run_command([executable, 'image', 'inspect', image_name])
if rc != 0:
module.fail_json(msg="Image %s inspection failed: %s" % (image_name, err2))