From dbd918865f61864712b623c6e41284b25c1ea92f Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sun, 23 Apr 2023 12:29:06 +0200 Subject: [PATCH] [PR #6385/ad6ff9b0 backport][stable-6] cpanm: apply MH feature (#6395) cpanm: apply MH feature (#6385) * cpanm: apply MH feature * add changelog frag (cherry picked from commit ad6ff9b0c5a14cf03f741e6a9e45897b75da33bb) Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> --- changelogs/fragments/6385-cpan-mh-feat.yml | 2 ++ plugins/modules/cpanm.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/6385-cpan-mh-feat.yml diff --git a/changelogs/fragments/6385-cpan-mh-feat.yml b/changelogs/fragments/6385-cpan-mh-feat.yml new file mode 100644 index 0000000000..41944b60f8 --- /dev/null +++ b/changelogs/fragments/6385-cpan-mh-feat.yml @@ -0,0 +1,2 @@ +minor_changes: + - cpanm - minor change, use feature from ``ModuleHelper`` (https://github.com/ansible-collections/community.general/pull/6385). diff --git a/plugins/modules/cpanm.py b/plugins/modules/cpanm.py index b3d63e1fb1..6260992dfe 100644 --- a/plugins/modules/cpanm.py +++ b/plugins/modules/cpanm.py @@ -183,7 +183,7 @@ class CPANMinus(ModuleHelper): if v.name and v.from_path: self.do_raise("Parameters 'name' and 'from_path' are mutually exclusive when 'mode=new'") - self.command = self.module.get_bin_path(v.executable if v.executable else self.command) + self.command = self.get_bin_path(v.executable if v.executable else self.command) self.vars.set("binary", self.command) def _is_package_installed(self, name, locallib, version):