From ee456487b782a3e37b8043f9537dc564aba1681d Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Fri, 20 Oct 2023 08:32:01 -0400 Subject: [PATCH] avocado.utils.podman: add version information utility Signed-off-by: Cleber Rosa --- avocado/utils/podman.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/avocado/utils/podman.py b/avocado/utils/podman.py index ba2bf32561..4f0886767a 100644 --- a/avocado/utils/podman.py +++ b/avocado/utils/podman.py @@ -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.