Open
Description
Describe the bug
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`"
Metadata
Metadata
Assignees
Labels
No labels