1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

apk: Fix failure when both install and upgrade in same command (#26666)

* apk: Fix failure when both install and upgrade in same command

If name list contains an installed package that needs upgrade plus a new package, apk command would fail due to missing space character.

* Simplify fix by concatenating lists
This commit is contained in:
tdtrask 2017-07-12 12:26:30 -04:00 committed by Brian Coca
parent 31b6ac896d
commit c24398cfd9

View file

@ -242,7 +242,7 @@ def install_packages(module, names, state):
upgrade = True
if not to_install and not upgrade:
module.exit_json(changed=False, msg="package(s) already installed")
packages = " ".join(to_install) + " ".join(to_upgrade)
packages = " ".join(to_install + to_upgrade)
if upgrade:
if module.check_mode:
cmd = "%s add --upgrade --simulate %s" % (APK_PATH, packages)