mirror of
https://github.com/ansible-collections/community.docker.git
synced 2025-12-16 11:58:43 +00:00
Better error message if Compose version is 'dev'. (#826)
This commit is contained in:
parent
8f3f310c78
commit
7102d38923
2
changelogs/fragments/826-docker-compose-v2-version.yml
Normal file
2
changelogs/fragments/826-docker-compose-v2-version.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
bugfixes:
|
||||||
|
- "docker_compose_v2* modules - abort with a nice error message instead of crash when the Docker Compose CLI plugin version is ``dev`` (https://github.com/ansible-collections/community.docker/issues/825, https://github.com/ansible-collections/community.docker/pull/826)."
|
||||||
@ -516,6 +516,12 @@ class BaseComposeManager(DockerBaseClass):
|
|||||||
compose = self.client.get_client_plugin_info('compose')
|
compose = self.client.get_client_plugin_info('compose')
|
||||||
if compose is None:
|
if compose is None:
|
||||||
self.client.fail('Docker CLI {0} does not have the compose plugin installed'.format(self.client.get_cli()))
|
self.client.fail('Docker CLI {0} does not have the compose plugin installed'.format(self.client.get_cli()))
|
||||||
|
if compose['Version'] == 'dev':
|
||||||
|
self.client.fail(
|
||||||
|
'Docker CLI {0} has a compose plugin installed, but it reports version "dev".'
|
||||||
|
' Please use a version of the plugin that returns a proper version.'
|
||||||
|
.format(self.client.get_cli())
|
||||||
|
)
|
||||||
compose_version = compose['Version'].lstrip('v')
|
compose_version = compose['Version'].lstrip('v')
|
||||||
self.compose_version = LooseVersion(compose_version)
|
self.compose_version = LooseVersion(compose_version)
|
||||||
if self.compose_version < LooseVersion(min_version):
|
if self.compose_version < LooseVersion(min_version):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user