From 4918ecd4c5d4e8d7725833ec3a08287ef8bf4327 Mon Sep 17 00:00:00 2001 From: Alexei Znamensky <103110+russoz@users.noreply.github.com> Date: Tue, 5 Aug 2025 06:00:46 +1200 Subject: [PATCH] easy_install: command args as list rather than string (#10526) * easy_install: command args as list rather than string * add changelog frag --- 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