From e0a86f172fbfe612eeed5d3d308b05fe67daeb11 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 20:50:48 +0200 Subject: [PATCH] [PR #10526/4918ecd4 backport][stable-11] easy_install: command args as list rather than string (#10589) easy_install: command args as list rather than string (#10526) * easy_install: command args as list rather than string * add changelog frag (cherry picked from commit 4918ecd4c5d4e8d7725833ec3a08287ef8bf4327) Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> --- changelogs/fragments/10526-easy-install-cmd-list.yml | 2 ++ plugins/modules/easy_install.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/10526-easy-install-cmd-list.yml diff --git a/changelogs/fragments/10526-easy-install-cmd-list.yml b/changelogs/fragments/10526-easy-install-cmd-list.yml new file mode 100644 index 0000000000..6fa6717adc --- /dev/null +++ b/changelogs/fragments/10526-easy-install-cmd-list.yml @@ -0,0 +1,2 @@ +minor_changes: + - easy_install - using safer mechanism to run external command (https://github.com/ansible-collections/community.general/pull/10526). diff --git a/plugins/modules/easy_install.py b/plugins/modules/easy_install.py index 8d0a39333e..3eb56ecd11 100644 --- a/plugins/modules/easy_install.py +++ b/plugins/modules/easy_install.py @@ -89,7 +89,7 @@ from ansible.module_utils.basic import AnsibleModule def install_package(module, name, easy_install, executable_arguments): - cmd = '%s %s %s' % (easy_install, ' '.join(executable_arguments), name) + cmd = [easy_install] + executable_arguments + [name] rc, out, err = module.run_command(cmd) return rc, out, err