docker_* modules: unify docker module version checks (#47046)

* Unify docker module version checks.

* Improve messages depending on required docker-py versions.

* Linting.
This commit is contained in:
Felix Fontein 2018-10-18 11:51:58 +02:00 committed by John R Barker
parent 4991ef30c2
commit 32e8251f86
11 changed files with 54 additions and 28 deletions

View file

@ -163,7 +163,7 @@ try:
from docker import utils
if HAS_DOCKER_PY_2 or HAS_DOCKER_PY_3:
from docker.types import IPAMPool, IPAMConfig
except:
except Exception as dummy:
# missing docker-py handled in ansible.module_utils.docker_common
pass
@ -384,6 +384,7 @@ def main():
client = AnsibleDockerClient(
argument_spec=argument_spec,
supports_check_mode=True
# "The docker server >= 1.9.0"
)
cm = DockerNetworkManager(client)