You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The pyinfra.facts.docker.DockerImages fact raises an exception if there is no image.
To Reproduce
Ensure there are no images present with docker image ls
Check the fact with host.get_fact(DockerImages)
Exception "docker image inspect requires at least on argument"
Expected behavior
I expect it to return an empty list instead of an exception
Meta
Pyinfra 3.2
The behavior is rather obvious when looking at the implementation of DockerImages. In case of no images, docker inspect runs with no arguments. Maybe it would be prudent to check for at least one image?
class DockerImages(DockerFactBase):
"""
Returns ``docker inspect`` output for all Docker images.
"""
def command(self) -> str:
return "docker image inspect `docker images -q`"
The text was updated successfully, but these errors were encountered:
Describe the bug
The pyinfra.facts.docker.DockerImages fact raises an exception if there is no image.
To Reproduce
Expected behavior
I expect it to return an empty list instead of an exception
Meta
Pyinfra 3.2
The behavior is rather obvious when looking at the implementation of DockerImages. In case of no images, docker inspect runs with no arguments. Maybe it would be prudent to check for at least one image?
The text was updated successfully, but these errors were encountered: