diff --git a/lib/ansible/modules/cloud/podman/podman_image_info.py b/lib/ansible/modules/cloud/podman/podman_image_info.py index c7f148ba9b3..071a1cbbfc0 100644 --- a/lib/ansible/modules/cloud/podman/podman_image_info.py +++ b/lib/ansible/modules/cloud/podman/podman_image_info.py @@ -173,7 +173,7 @@ 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.split('\n') + name = out.strip().split('\n') out = get_image_info(module, executable, name) return out