fix support containers under podman (#76292)

* `podman inspect` falls back to a same-named image if the named container is not present; since eg `http-test-container` is both the name of the image and container, it wasn't working properly under podman in many instances. Switching to `docker|podman container inspect` limits the query to containers only for both podman and docker, allowing the support container detection/creation to work properly.
pull/76295/head
Matt Davis 3 years ago committed by GitHub
parent 382a353234
commit abac141122
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- ansible-test - fixed support container failures (eg http-test-container) under podman

@ -401,11 +401,11 @@ class DockerInspect:
def docker_inspect(args, identifier, always=False): # type: (EnvironmentConfig, str, bool) -> DockerInspect
"""
Return the results of `docker inspect` for the specified container.
Return the results of `docker container inspect` for the specified container.
Raises a ContainerNotFoundError if the container was not found.
"""
try:
stdout = docker_command(args, ['inspect', identifier], capture=True, always=always)[0]
stdout = docker_command(args, ['container', 'inspect', identifier], capture=True, always=always)[0]
except SubprocessError as ex:
stdout = ex.stdout

Loading…
Cancel
Save