-
Notifications
You must be signed in to change notification settings - Fork 25
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
Fix parameters with aliases not being passed #92
Fix parameters with aliases not being passed #92
Conversation
The recently added _is_an_alias() function should check whether the current key is in the list of aliases.
I did play a bit with this in xlab-steampunk@5b72fcb and once I wrote that last unit test, I knew things will not be as easy to solve as they looked like. We cannot just drop any aliased parameter because we can drop the only piece of information when doing so. I did not work any further on this because I do not know why all that argument handling is there and would take me too long to figure things out. And the fact that the turbo code needs three fork calls to do the double-fork daemonization dance did not fill me with confidence ;) Edit: PR I experimented in is #90 |
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.
LGTM!
Closing/opening because I had to manually push a missing commit. |
@goneri I think this one is going to fail until ansible-collections/kubernetes.core#261 gets merged. |
Should I disable ansible-test-molecule-kubernetes-core-with-turbo until we land this PR? |
Yeah, let's do that. |
recheck |
cloud.common: temp turn k8s check non voting Temporarily disable ansible-test-molecule-kubernetes-core-with-turbo until we land ansible-collections/cloud.common#92. Reviewed-by: None <None>
If I understand things correctly, this fix is not OK. What if we only see one of the aliases being set? Test case I came up with when I was playing with this: https://github.com/xlab-steampunk/cloud.common/blob/5b72fcba614754bc759c2b85c86a2573f035a151/tests/unit/module_utils/test_turbo_module.py#L149-L155 I am pretty sure this test will fail since argument processing will throw away the bar value. |
@tadeboro The arg spec in your example doesn't look like a legitimate arg spec. It is declaring
|
That is indeed not a valid argspec, but the When you updated the tests in this PR, you actually made them useless because they operate on data structures they will never encounter in the wild. |
I think the issue is that the |
Well, if you pass a regular argspec to the As I said before, I ran out of time before I was able to determine why exactly argument manipulation is needed, but my gut was telling me that the
args = ansible.module_utils.basic._ANSIBLE_ARGS . This would also simplify the server implementation a lot, but I am assuming that I am missing some important pieces of information original author of the code considered when writing the code.
|
When I did that, the arguments AND their aliases were exposed in |
The
Well, while the
I do not doubt this. But in my opinion, perfection should not stand in the way of progress and getting rid of argument mangling would be one large step forward in paying back some technical debt in the turbo module implementation. |
Remove molecule dependencies SUMMARY Depends-on: ansible-collections/cloud.common#92 Molecule is overwriting the cloud.common dependency installed by zuul, which is causing issues with the CI job for turbo mode. We still need to find a way to test against the latest released version of cloud.common. ISSUE TYPE Bugfix Pull Request COMPONENT NAME ADDITIONAL INFORMATION Reviewed-by: Gonéri Le Bouder <goneri@lebouder.net> Reviewed-by: None <None>
Remove molecule dependencies SUMMARY Depends-on: ansible-collections/cloud.common#92 Molecule is overwriting the cloud.common dependency installed by zuul, which is causing issues with the CI job for turbo mode. We still need to find a way to test against the latest released version of cloud.common. ISSUE TYPE Bugfix Pull Request COMPONENT NAME ADDITIONAL INFORMATION Reviewed-by: Gonéri Le Bouder <goneri@lebouder.net> Reviewed-by: None <None> (cherry picked from commit ff43353)
Remove molecule dependencies SUMMARY Depends-on: ansible-collections/cloud.common#92 Molecule is overwriting the cloud.common dependency installed by zuul, which is causing issues with the CI job for turbo mode. We still need to find a way to test against the latest released version of cloud.common. ISSUE TYPE Bugfix Pull Request COMPONENT NAME ADDITIONAL INFORMATION Reviewed-by: Gonéri Le Bouder <goneri@lebouder.net> Reviewed-by: None <None> (cherry picked from commit ff43353)
Revert "cloud.common: temp turn k8s check non votin (#1176)" Depends-On: ansible-collections/cloud.common#92 Depends-On: ansible-collections/kubernetes.core#261 This reverts commit 20f0173 introduced by #1176. Reviewed-by: None <None>
Depends-On: ansible/ansible-zuul-jobs#1176
SUMMARY
The recently added _is_an_alias() function should check whether the
current key is in the list of aliases.
Fixes: #91
ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION