mirror of
https://github.com/containers/ansible-podman-collections.git
synced 2026-02-04 07:11:49 +00:00
Fix volume inspection by name in podman_volume (#684)
Fix #661 Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
This commit is contained in:
parent
edcb13dd8a
commit
e245e332f0
1 changed files with 7 additions and 1 deletions
|
|
@ -327,7 +327,13 @@ class PodmanVolume:
|
|||
# pylint: disable=unused-variable
|
||||
rc, out, err = self.module.run_command(
|
||||
[self.module.params['executable'], b'volume', b'inspect', self.name])
|
||||
return json.loads(out)[0] if rc == 0 else {}
|
||||
if rc == 0:
|
||||
data = json.loads(out)
|
||||
if data:
|
||||
data = data[0]
|
||||
if data.get("Name") == self.name:
|
||||
return data
|
||||
return {}
|
||||
|
||||
def _get_podman_version(self):
|
||||
# pylint: disable=unused-variable
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue