mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00: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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user