Skip to content

Commit

Permalink
Improve API version handling. (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein authored Jun 20, 2022
1 parent c4e2117 commit a44e073
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/389-api-version.yml
Original file line number Diff line number Diff line change
@@ -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)."
2 changes: 1 addition & 1 deletion plugins/module_utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def __init__(self, min_docker_version=None, min_docker_api_version=None):

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:
Expand Down

0 comments on commit a44e073

Please sign in to comment.