Skip to content

Commit

Permalink
command warnings: don't send the param from action (#70531)
Browse files Browse the repository at this point in the history
Change:
- Followup to #70504. We need to not pass the 'warn' parameter from the
  action plugin either, unless it's True. Otherwise, even though it
  defaults to false, we always show the deprecation.

Test Plan:
- Local

Signed-off-by: Rick Elrod <rick@elrod.me>
  • Loading branch information
relrod committed Jul 9, 2020
1 parent f7db428 commit 28fda23
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
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:
self._task.args['warn'] = C.COMMAND_WARNINGS

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

0 comments on commit 28fda23

Please sign in to comment.