New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error if docker and docker-py are simultaneously #38884
Error if docker and docker-py are simultaneously #38884
Conversation
…f each other. Fixes ansible#36125
@@ -144,6 +163,10 @@ def __init__(self, argument_spec=None, supports_check_mode=False, mutually_exclu | |||
required_together=required_together_params, | |||
required_if=required_if) | |||
|
|||
if HAS_DOCKER_MODELS and HAS_DOCKER_SSLADAPTER: | |||
self.fail("Cannot have both the docker-py and docker python modules installed installed together as they use the same namespace and " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Message cleanup needed. Notice installed installed
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate "installed" removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was merged so fast I didn't put in my $0.02: 'docker' and 'docker-py' are not 'python modules'. They are 'python packages' and should be called that to avoid confusion with Ansible's 'docker modules'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest this language be:
Cannot have both the docker-py and docker Python packages installed together as they use the same namespace and cause a corrupt installation. Please uninstall both packages, and re-install only the docker-py or docker Python package.
If it's possible to add a single quote without causing a parsing problem, it would be even better as:
Cannot have both the 'docker-py' and 'docker' Python packages installed together as they use the same namespace and cause a corrupt installation. Please uninstall both packages, and re-install only the 'docker-py' or 'docker' Python package.
One small comment on message text. Otherwise, LGTM. |
CI fail is an 'Unstabble' Fedora 24 thing that seems unrelated. Merging. |
* Error if docker and docker-py are simultaneously installed over top of each other. Fixes ansible#36125 * Remove duplicate installed (cherry picked from commit 68e3ff8)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error could be changed if you feel it appropriate
@@ -144,6 +163,10 @@ def __init__(self, argument_spec=None, supports_check_mode=False, mutually_exclu | |||
required_together=required_together_params, | |||
required_if=required_if) | |||
|
|||
if HAS_DOCKER_MODELS and HAS_DOCKER_SSLADAPTER: | |||
self.fail("Cannot have both the docker-py and docker python modules installed installed together as they use the same namespace and " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was merged so fast I didn't put in my $0.02: 'docker' and 'docker-py' are not 'python modules'. They are 'python packages' and should be called that to avoid confusion with Ansible's 'docker modules'.
@@ -144,6 +163,10 @@ def __init__(self, argument_spec=None, supports_check_mode=False, mutually_exclu | |||
required_together=required_together_params, | |||
required_if=required_if) | |||
|
|||
if HAS_DOCKER_MODELS and HAS_DOCKER_SSLADAPTER: | |||
self.fail("Cannot have both the docker-py and docker python modules installed installed together as they use the same namespace and " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest this language be:
Cannot have both the docker-py and docker Python packages installed together as they use the same namespace and cause a corrupt installation. Please uninstall both packages, and re-install only the docker-py or docker Python package.
If it's possible to add a single quote without causing a parsing problem, it would be even better as:
Cannot have both the 'docker-py' and 'docker' Python packages installed together as they use the same namespace and cause a corrupt installation. Please uninstall both packages, and re-install only the 'docker-py' or 'docker' Python package.
… docker-py installed. Ref: ansible/ansible#38884
* Error if docker and docker-py are simultaneously installed over top of each other. Fixes ansible#36125 * Remove duplicate installed
SUMMARY
Error if docker and docker-py are simultaneously installed over top of each other. Fixes #36125
I did a bit of research and found that
docker.models
only exists in thedocker
python package, anddocker.ssladapter
only indocker-py
. By importing these we can determine if they are installed simultaneously and error appropriately.ISSUE TYPE
COMPONENT NAME
lib/ansible/module_utils/docker_common.py
ANSIBLE VERSION
ADDITIONAL INFORMATION