1
0
Fork 0
mirror of https://github.com/containers/ansible-podman-collections.git synced 2026-02-04 07:11:49 +00:00

Fix error with images info where no images (#233)

This commit is contained in:
Sergey 2021-04-02 03:53:05 +03:00 committed by GitHub
parent 46020ecf80
commit 2b456dfe8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 5 deletions

View file

@ -197,10 +197,12 @@ def get_image_info(module, executable, name):
def get_all_image_info(module, executable):
command = [executable, 'image', 'ls', '-q']
rc, out, err = module.run_command(command)
name = out.strip().split('\n')
out = get_image_info(module, executable, name)
return out
out = out.strip()
if out:
name = out.split('\n')
res = get_image_info(module, executable, name)
return res
return json.dumps([])
def main():