-
Notifications
You must be signed in to change notification settings - Fork 23.9k
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
Sanitize debug var= tasks of the loop variable #66269
base: devel
Are you sure you want to change the base?
Conversation
@@ -263,6 +263,10 @@ def _clean_results(self, result, task_name): | |||
# 'var' value as field, so eliminate others and what is left should be varname | |||
for hidme in self._hide_in_debug: | |||
result.pop(hidme, None) | |||
# when using loop control, remove whatever is under loop_var | |||
if 'ansible_loop_var' in result: |
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.
We might want to do the same for ansible_index_var
variable too.
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.
good call, added that to the test playbook and found it show up. Pushing change now.
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.
actually, any var that is not the 'item' in vars= should be removed
c606366
to
6f570ca
Compare
I found that this afflicts Ansible 2.9 as well, since it's a bug fix, I'm going to add the changelog |
6f570ca
to
9843236
Compare
9843236
to
3d8abdb
Compare
0885c08
to
d9269d6
Compare
/azp run |
No commit pushedDate could be found for PR 66269 in repo ansible/ansible |
This PR needs to be rebased before CI can run. |
@mattclay that |
/azp run |
No commit pushedDate could be found for PR 66269 in repo ansible/ansible |
After seeing the |
I'll try closing and re-opening to see if that changes things. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
That seems to have worked. So perhaps the |
Yeah, I wanted to see if the new bot would remove the label or not. If not, I was thinking we might want to update our search filter to exclude This PR still needs a rebase to have a chance at passing CI. That's no longer due to the |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@AlanCoding could you rebase? |
SUMMARY
Proposed fix for #65856
ISSUE TYPE
COMPONENT NAME
debug
ADDITIONAL INFORMATION
I have a test case for this, modeled after
ansible/test/integration/targets/loop_control/runme.sh
Line 10 in 495c197
(you have to manually inspect the exit code in that case)
inside runme.sh
inside loop_test.yml
I am less confident about integrating this into the tests, although there really shouldn't be a problem with it.
and I confirm exit code 1 with devel and exit code 0 with this patch.