Improve API version handling. (#389)

This commit is contained in:
Felix Fontein 2022-06-20 07:34:38 +02:00 committed by GitHub
parent c4e2117844
commit a44e0736cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -0,0 +1,2 @@
bugfixes:
- "Docker SDK for Python based modules and plugins - if the API version is specified as an option, use that one to validate API version requirements of module/plugin options instead of the latest API version supported by the Docker daemon. This also avoids one unnecessary API call per module/plugin (https://github.com/ansible-collections/community.docker/pull/389)."

View File

@ -308,7 +308,7 @@ class AnsibleDockerClientBase(Client):
try:
super(AnsibleDockerClientBase, self).__init__(**self._connect_params)
self.docker_api_version_str = self.version()['ApiVersion']
self.docker_api_version_str = self.api_version
except APIError as exc:
self.fail("Docker API error: %s" % exc)
except Exception as exc: