From fec81a0b40aee5ac8955075c4f9030e865b496a1 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 29 Jun 2024 18:51:15 +0200 Subject: [PATCH] Use LooseVersion instead of StrictVersion to parse urllib3 versions. --- changelogs/fragments/902-loose-version.yml | 2 ++ plugins/module_utils/_api/transport/ssladapter.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/902-loose-version.yml diff --git a/changelogs/fragments/902-loose-version.yml b/changelogs/fragments/902-loose-version.yml new file mode 100644 index 000000000..198b16233 --- /dev/null +++ b/changelogs/fragments/902-loose-version.yml @@ -0,0 +1,2 @@ +bugfixes: + - "vendored Docker SDK for Python - use ``LooseVersion`` instead of ``StrictVersion`` to compare urllib3 versions. This is needed for development versions (https://github.com/ansible-collections/community.docker/pull/902)." diff --git a/plugins/module_utils/_api/transport/ssladapter.py b/plugins/module_utils/_api/transport/ssladapter.py index ed9250d6a..7f5906e6a 100644 --- a/plugins/module_utils/_api/transport/ssladapter.py +++ b/plugins/module_utils/_api/transport/ssladapter.py @@ -15,7 +15,7 @@ https://github.com/kennethreitz/requests/pull/799 """ -from ansible_collections.community.docker.plugins.module_utils.version import StrictVersion +from ansible_collections.community.docker.plugins.module_utils.version import LooseVersion from .._import_helper import HTTPAdapter, urllib3 from .basehttpadapter import BaseHTTPAdapter @@ -66,4 +66,4 @@ def can_override_ssl_version(self): return False if urllib_ver == 'dev': return True - return StrictVersion(urllib_ver) > StrictVersion('1.5') + return LooseVersion(urllib_ver) > LooseVersion('1.5')