Skip to content

Commit

Permalink
avocado.utils.podman: add version information utility
Browse files Browse the repository at this point in the history
Signed-off-by: Cleber Rosa <[email protected]>
  • Loading branch information
clebergnu committed Oct 20, 2023
1 parent 13f067f commit ee45648
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions avocado/utils/podman.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ def __init__(self, podman_bin=None):

self.podman_bin = path

async def version(self):
try:
version = await self.execute("version", "--format=json")
return json.loads(version)
except PodmanException as ex:
raise PodmanException("Failed to get podman version information")

async def execute(self, *args):
"""Execute a command and return the returncode, stdout and stderr.
Expand Down

0 comments on commit ee45648

Please sign in to comment.