Improve API version handling. (#389) (#391)

(cherry picked from commit a44e0736cf)

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
patchback[bot] 2022-06-20 07:58:38 +02:00 committed by GitHub
parent dc86cbef58
commit edf1953fd5
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

@ -309,7 +309,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: