From aa4161ee03e429390222c350a35c4307cf92c342 Mon Sep 17 00:00:00 2001 From: Sagi Shnaidman Date: Fri, 11 Oct 2019 14:35:20 +0300 Subject: [PATCH] Use executable for podman container from params till now execultable parameter was ignored, use it for creating podman commands. Change-Id: I3a7424950c165e63767edcc0e921ce486f4f0c73 --- .../ansible_plugins/modules/podman_container.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tripleo_ansible/ansible_plugins/modules/podman_container.py b/tripleo_ansible/ansible_plugins/modules/podman_container.py index 2468685d0..21460e248 100644 --- a/tripleo_ansible/ansible_plugins/modules/podman_container.py +++ b/tripleo_ansible/ansible_plugins/modules/podman_container.py @@ -1175,13 +1175,16 @@ def ensure_image_exists(module, image): list -- list of image actions - if it pulled or nothing was done """ image_actions = [] + module_exec = module.params['executable'] if not image: return image_actions - rc, out, err = run_podman_command(module, args=['image', 'exists', image], + rc, out, err = run_podman_command(module, executable=module_exec, + args=['image', 'exists', image], ignore_errors=True) if rc == 0: return image_actions - rc, out, err = run_podman_command(module, args=['image', 'pull', image], + rc, out, err = run_podman_command(module, executable=module_exec, + args=['image', 'pull', image], ignore_errors=True) if rc != 0: module.fail_json(msg="Can't pull image %s" % image, stdout=out, @@ -1235,6 +1238,7 @@ class PodmanContainer: """Inspect container and gather info about it.""" rc, out, err = run_podman_command( module=self.module, + executable=self.module.params['executable'], args=['container', 'inspect', self.name], ignore_errors=True) return json.loads(out)[0] if rc == 0 else {}