Skip to content
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

command warnings: don't send the param from action #70531

Merged
merged 1 commit into from Jul 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/command-warnings-deprecation-2.yml
@@ -0,0 +1,2 @@
bugfixes:
- Fix to previous deprecation change (#70504) which caused command warning deprecation to show in all cases, even when not specified by the user.
2 changes: 1 addition & 1 deletion lib/ansible/plugins/action/command.py
Expand Up @@ -17,7 +17,7 @@ def run(self, tmp=None, task_vars=None):
del tmp # tmp no longer has any effect

# Command module has a special config option to turn off the command nanny warnings
if 'warn' not in self._task.args:
if 'warn' not in self._task.args and C.COMMAND_WARNINGS:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this changes the meaning, before we only set the configured default if it was not set in the task itself, now we only set it if the configured default is true.

what you really want is to set it if the configured default is explicit and not from 'default', so those setting it to 'false' in the configuration should also get a warning. (use get_config_value_and_origin to get both value and where it was set from)

self._task.args['warn'] = C.COMMAND_WARNINGS

wrap_async = self._task.async_val and not self._connection.has_native_async
Expand Down