From 4e1ba6af4660ae29c3cff85799a98f390cb82f0e Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sat, 29 Jul 2023 21:40:02 +0200 Subject: [PATCH] [PR #7028/3a7044e2 backport][stable-6] ejabberd_user: better error when command not installed (#7029) ejabberd_user: better error when command not installed (#7028) * ejabberd_user: better error when command not installed * add changelog frag (cherry picked from commit 3a7044e2b85a6452c90d492505d9b7b18c70cef6) Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> --- changelogs/fragments/6949-ejabberdctl-error.yml | 2 ++ plugins/modules/ejabberd_user.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/6949-ejabberdctl-error.yml diff --git a/changelogs/fragments/6949-ejabberdctl-error.yml b/changelogs/fragments/6949-ejabberdctl-error.yml new file mode 100644 index 0000000000..be2294ffa3 --- /dev/null +++ b/changelogs/fragments/6949-ejabberdctl-error.yml @@ -0,0 +1,2 @@ +bugfixes: + - ejabberd_user - provide meaningful error message when the ``ejabberdctl`` command is not found (https://github.com/ansible-collections/community.general/pull/7028, https://github.com/ansible-collections/community.general/issues/6949). diff --git a/plugins/modules/ejabberd_user.py b/plugins/modules/ejabberd_user.py index 397207ae61..a8872cacc3 100644 --- a/plugins/modules/ejabberd_user.py +++ b/plugins/modules/ejabberd_user.py @@ -122,7 +122,7 @@ class EjabberdUser(object): """ This method will run the any command specified and return the returns using the Ansible common module """ - cmd = [self.module.get_bin_path('ejabberdctl'), cmd] + options + cmd = [self.module.get_bin_path('ejabberdctl', required=True), cmd] + options self.log('command: %s' % " ".join(cmd)) return self.module.run_command(cmd)