From 9e61952cdcde036a8a5b7ac7b9c062b127d248d4 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Wed, 28 Apr 2021 19:52:15 +0530 Subject: [PATCH] command - add command name to warning (#74475) --- changelogs/fragments/cmd_wording.yml | 2 ++ lib/ansible/modules/command.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/cmd_wording.yml diff --git a/changelogs/fragments/cmd_wording.yml b/changelogs/fragments/cmd_wording.yml new file mode 100644 index 00000000000..95da8ca2dd4 --- /dev/null +++ b/changelogs/fragments/cmd_wording.yml @@ -0,0 +1,2 @@ +minor_changes: +- command - update the user warning message to point out command name (https://github.com/ansible/ansible/pull/74475). diff --git a/lib/ansible/modules/command.py b/lib/ansible/modules/command.py index e95fbdfc2e0..1ccd3388b26 100644 --- a/lib/ansible/modules/command.py +++ b/lib/ansible/modules/command.py @@ -232,9 +232,9 @@ def check_command(module, commandline): command = commandline.split()[0] command = os.path.basename(command) - disable_suffix = "If you need to use command because {mod} is insufficient you can add" \ + disable_suffix = "If you need to use '{cmd}' because the {mod} module is insufficient you can add" \ " 'warn: false' to this command task or set 'command_warnings=False' in" \ - " ansible.cfg to get rid of this message." + " the defaults section of ansible.cfg to get rid of this message." substitutions = {'mod': None, 'cmd': command} if command in arguments: