mirror of
https://github.com/ansible-collections/community.docker.git
synced 2025-12-15 19:42:06 +00:00
docker.py: allow docker versions beginning with 'v' (#76)
* docker.py: allow docker versions with a leading 'v' * Update changelogs/fragments/76-leading-v-support-in-docker-version.yml Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
a298906dbe
commit
43cbe3095b
@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- docker connection plugin - fix Docker version parsing, as some docker versions have a leading ``v`` in the output of the command ``docker version --format "{{.Server.Version}}"`` (https://github.com/ansible-collections/community.docker/pull/76).
|
||||
@ -120,7 +120,9 @@ class Connection(ConnectionBase):
|
||||
|
||||
@staticmethod
|
||||
def _sanitize_version(version):
|
||||
return re.sub(u'[^0-9a-zA-Z.]', u'', version)
|
||||
version = re.sub(u'[^0-9a-zA-Z.]', u'', version)
|
||||
version = re.sub(u'^v', u'', version)
|
||||
return version
|
||||
|
||||
def _old_docker_version(self):
|
||||
cmd_args = []
|
||||
|
||||
Loading…
Reference in New Issue
Block a user