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:
parent
9a2a8f5e0f
commit
f87d187733
|
@ -66,7 +66,7 @@ class LocalPsTest(testtools.TestCase):
|
|||
processes = sh.list_processes(command_line='cat -',
|
||||
ssh_client=self.ssh_client)
|
||||
for process in processes:
|
||||
self.assertTrue('cat', process.command)
|
||||
self.assertEqual('cat', process.command)
|
||||
self.assertEqual(('cat', '-'), process.command_line)
|
||||
cat_process.kill()
|
||||
sh.wait_for_processes(command_line='cat -',
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue