Fix issue when parsing podman/docker version output

Added IGNORECASE to the regex matching because parsing did not work fine
in some cases

Change-Id: I8be90c969f52ac800f774a92e3cd5432701c2312
This commit is contained in:
Eduardo Olivares 2021-07-26 15:04:30 +02:00
parent 9a2a8f5e0f
commit 2cc25e25a4
1 changed files with 2 additions and 2 deletions

View File

@ -60,7 +60,7 @@ class ContainerRuntime(abc.ABC):
class DockerContainerRuntime(ContainerRuntime):
runtime_name = 'docker'
version_pattern = re.compile('Docker version .*')
version_pattern = re.compile('Docker version .*', re.IGNORECASE)
def _get_client(self, ssh_client):
return docker.get_docker_client(ssh_client=ssh_client,
@ -73,7 +73,7 @@ class DockerContainerRuntime(ContainerRuntime):
class PodmanContainerRuntime(ContainerRuntime):
runtime_name = 'podman'
version_pattern = re.compile('Podman version .*')
version_pattern = re.compile('Podman version .*', re.IGNORECASE)
def _get_client(self, ssh_client):
return podman.get_podman_client(ssh_client=ssh_client).connect()