[PR #10525/5bdd82fb backport][stable-11] composer: command args as list rather than string (#10590)

composer: command args as list rather than string (#10525)

* composer: command args as list rather than string

* add changelog frag

(cherry picked from commit 5bdd82fbf5)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2025-08-04 20:50:58 +02:00 committed by GitHub
commit d65b6edfaf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- composer - using safer mechanism to run external command (https://github.com/ansible-collections/community.general/pull/10525).

View file

@ -188,7 +188,7 @@ def composer_command(module, command, arguments="", options=None):
else: else:
composer_path = module.params['composer_executable'] composer_path = module.params['composer_executable']
cmd = "%s %s %s %s %s %s" % (php_path, composer_path, "global" if global_command else "", command, " ".join(options), arguments) cmd = [php_path, composer_path, "global" if global_command else "", command] + options + [arguments]
return module.run_command(cmd) return module.run_command(cmd)