Skip to content

Commit

Permalink
Fix volume inspection by name in podman_volume (#684)
Browse files Browse the repository at this point in the history
Fix #661
Signed-off-by: Sagi Shnaidman <[email protected]>
  • Loading branch information
sshnaidm authored Dec 3, 2023
1 parent edcb13d commit e245e33
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugins/modules/podman_volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,13 @@ def get_info(self):
# 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
Expand Down

0 comments on commit e245e33

Please sign in to comment.