From 28fda23284e0cc8be5b43a9ac870cb678cfa1f08 Mon Sep 17 00:00:00 2001 From: Rick Elrod Date: Thu, 9 Jul 2020 13:13:10 -0500 Subject: [PATCH] command warnings: don't send the param from action (#70531) 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 --- changelogs/fragments/command-warnings-deprecation-2.yml | 2 ++ lib/ansible/plugins/action/command.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/command-warnings-deprecation-2.yml diff --git a/changelogs/fragments/command-warnings-deprecation-2.yml b/changelogs/fragments/command-warnings-deprecation-2.yml new file mode 100644 index 00000000000..e81b24cf1fd --- /dev/null +++ b/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. diff --git a/lib/ansible/plugins/action/command.py b/lib/ansible/plugins/action/command.py index 79f1a7ff034..46fcc9b3120 100644 --- a/lib/ansible/plugins/action/command.py +++ b/lib/ansible/plugins/action/command.py @@ -17,7 +17,7 @@ class ActionModule(ActionBase): 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