Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 changes the meaning, to preserve the same meaning it would have to be
ansible.legacy.shell
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.
Thanks for spotting that @bcoca
I'm going to update the examples here to use one of the
ansible.builtin
modules. I could be wrong in my thinking but it seems like we wouldn't want users to go with theansible.legacy.shell
module so putting it in the "Correct Code" example might not be the right thing to do.@ssbarnea I actually got this from the test at:
ansible-lint/src/ansiblelint/rules/fqcn_builtins.py
Line 109 in e79e65c
Do you think this might need an update based on Brian's comment as well? Thanks.
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 difference between legacy and builtin is subtle and most users won't care, but the ones that do ... will find themselves with an unexpected change in behavior. legacy allows local overrides while builtin does not, most people don't have local overrides, but those that do, depend on them.
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.
@bcoca Any documentation links pointing to difference between the two that we can include in this markdown file?
In the end we just give an example of "modernizing" the code, that does not mean that the right answer is always appending "ansible.builtins." prefix. Still, adding an extra note/link regarding the nuances could only be seen as beneficial, convincing user to make a more informed decision.
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.
:-( no, cannot find it ever making the docs