-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
clarify port.mode paramter requiremets, fail if unmet #47938
clarify port.mode paramter requiremets, fail if unmet #47938
Conversation
Hi @dariko, thank you for submitting this pull-request! |
@@ -457,7 +457,7 @@ | |||
import time | |||
from ansible.module_utils.docker_common import DockerBaseClass | |||
from ansible.module_utils.docker_common import AnsibleDockerClient | |||
from ansible.module_utils.docker_common import HAS_DOCKER_PY_3 | |||
from module_utils.docker_common import docker_version |
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.
Ah, sorry, I think it also needs ansible.
(as all the others). I wrote that down from my head, and it looks like I forgot something :)
Also, why don't you combine the above lines to:
from ansible.module_utils.docker_common import (
DockerBaseClass, AnsibleDockerClient, docker_version,
)
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.
(Combining them is a matter of style, so feel free to ignore that :) It just came to my mind when I saw the lines...)
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.
Right... this time I tested it before pushing 😄
I simply didn't know that syntax, It's definitely better.
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.
Looks like CI does not like that syntax, it's throwing this error
02:49 Run command: /usr/bin/python test/sanity/validate-modules/validate-modules --format json --arg-spec lib/ansible/modules/cloud/docker/docker_swarm_service.py --base-branch origin/devel
02:50 ERROR: Found 1 validate-modules issue(s) which need to be resolved:
02:50 ERROR: lib/ansible/modules/cloud/docker/docker_swarm_service.py:0:0: E321 Exception attempting to import module for argument_spec introspection, 'cannot import name 'docker_version'' (75%)
I'll go back to the more extensive form
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.
The problem is unrelated to this change, it was already caused by the change before (using docker_version
instead of HAS_DOCKER_PY_3
). But that can be easily fixed by setting docker_version
to None
if docker-py cannot be imported (see my comment below).
@@ -0,0 +1,2 @@ | |||
minor_changes: |
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.
How about making this a bugfix (i.e. bugfixes:
)?
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.
Just a bugfix or a minor change and a bugfix?
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.
I would make it simply a bugfix. And maybe also add that the parameter was simply ignored for that docker-py version before this fix. (I can't really think of any reason why the old behavior would have been useful...)
7590f7c
to
ce6f74c
Compare
About the failing tests: the problem is that |
The test
The test
The test
The test
The test
The test
|
changelogs/fragments/47938-docker_swarm_service-requirements.yaml
Outdated
Show resolved
Hide resolved
The test
The test
The test
The test
The test
The test
|
@dariko if this should go into Ansible 2.7.2, we should have it merged and a backport ready until upcoming Monday. |
@dariko this PR contains the following merge commits: Please rebase your branch to remove these commits. |
@dariko This PR was evaluated as a potentially problematic PR for the following reasons:
Such PR can only be merged by human. Contact a Core team member to review this PR on IRC: |
3293cd7
to
750a3e7
Compare
@felixfontein I rebased to devel, now the the tests run without errors, I can open a backport PR as soon as this is merged. |
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.
shitip
shipit |
typo of the year... :D |
@felixfontein Yes, otherwise the tests will fail; I'll cherry-pick this PR merge commit and c062f37 |
@dariko Thank you for the PR Merged into |
@dariko do you have time to do the backport today? If not, I can also do it this evening. |
* clarify port.mode paramter requiremets, fail if unmet * changelog fragment * shorten too long line * remove unnecessary indentation * test version on docker_version for better maintainability * normalize imports * changelog fragment: minor_changes -> bugfixes * rollback e96a7e57dfefd566fa47cf465a759637affd4795 * typo Co-Authored-By: dariko <dariko@users.noreply.github.com> (cherry picked from commit 89bcd3f)
@felixfontein thank you for everything :) I created the backport PR #48565; I never opened a backport PR before.. I hope it is all right. |
@dariko you're welcome! Creating a backport is usually pretty simple, after a few times you usually even remember the branch name format (took me some more times I think ;) ). |
@gundalow thank you, that's the guide i followed! |
* clarify port.mode paramter requiremets, fail if unmet * changelog fragment * shorten too long line * remove unnecessary indentation * test version on docker_version for better maintainability * normalize imports * changelog fragment: minor_changes -> bugfixes * rollback e96a7e57dfefd566fa47cf465a759637affd4795 * typo Co-Authored-By: dariko <dariko@users.noreply.github.com>
* clarify port.mode paramter requiremets, fail if unmet * changelog fragment * shorten too long line * remove unnecessary indentation * test version on docker_version for better maintainability * normalize imports * changelog fragment: minor_changes -> bugfixes * rollback e96a7e57dfefd566fa47cf465a759637affd4795 * typo Co-Authored-By: dariko <dariko@users.noreply.github.com> (cherry picked from commit 89bcd3f)
* clarify port.mode paramter requiremets, fail if unmet * changelog fragment * shorten too long line * remove unnecessary indentation * test version on docker_version for better maintainability * normalize imports * changelog fragment: minor_changes -> bugfixes * rollback e96a7e57dfefd566fa47cf465a759637affd4795 * typo Co-Authored-By: dariko <dariko@users.noreply.github.com>
* clarify port.mode paramter requiremets, fail if unmet * changelog fragment * shorten too long line * remove unnecessary indentation * test version on docker_version for better maintainability * normalize imports * changelog fragment: minor_changes -> bugfixes * rollback e96a7e57dfefd566fa47cf465a759637affd4795 * typo Co-Authored-By: dariko <dariko@users.noreply.github.com>
Fixes #47737
Docker python library supports enpointspec.publishmode only since version
3.0.0
, and ignores it in previous releases publishing the port via vip.This PR clarifies the documentation and has the module fail if the publish.mode parameter is used with a docker python library version <3.0.0