diff --git a/changelog/62882.fixed b/changelog/62882.fixed new file mode 100644 index 000000000000..015b55fdfafc --- /dev/null +++ b/changelog/62882.fixed @@ -0,0 +1 @@ +Fixed dockermod version_info function for docker-py 6.0.0+ diff --git a/salt/modules/dockermod.py b/salt/modules/dockermod.py index d8581586ca72..6870c26b0e61 100644 --- a/salt/modules/dockermod.py +++ b/salt/modules/dockermod.py @@ -344,7 +344,12 @@ def _get_docker_py_versioninfo(): try: return docker.version_info except AttributeError: - pass + # docker 6.0.0+ exposes version from __version__ attribute + try: + docker_version = docker.__version__.split(".") + return tuple(int(n) for n in docker_version) + except AttributeError: + pass def _get_client(timeout=NOTSET, **kwargs):