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
deprecated-local-action: refactor to use matchtask() #2238
deprecated-local-action: refactor to use matchtask() #2238
Conversation
Signed-off-by: nishipy <goodisonev4@gmail.com>
Signed-off-by: nishipy <goodisonev4@gmail.com>
Signed-off-by: nishipy <goodisonev4@gmail.com>
Signed-off-by: nishipy <goodisonev4@gmail.com>
29d7438
to
0f97a0e
Compare
Signed-off-by: nishipy <goodisonev4@gmail.com>
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.
Nice! I left a comment about a possible alternative implementation. This is exciting to see all these improvements! Thank you!
src/ansiblelint/utils.py
Outdated
|
||
# check if module invocated with old style | ||
old_style_keys = ("local_action",) | ||
result = _extract_old_style_keys_from_task(result, sanitized_task, old_style_keys) |
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 is kind of cool.
But, we might not need to change any of the utils because of another newish feature: needs_raw_task
.
If the rule class has needs_raw_task = True
as a class level variable, then matchtask
gets passed the raw/unparsed task in task["__raw_task__"]
.
Would that work here?
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.
Thank you! Using task["__raw_task__"]
looks smart and enough for us. Let me fix that.
SUCCESS_TASK = """ | ||
- name: task example | ||
boto3_facts: | ||
delegate_to: localhost # local_action |
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.
Sweet example!
Signed-off-by: nishipy <goodisonev4@gmail.com>
A part of #2105.
This PR fixes the following points for
deprecated-local-action
: