From c24398cfd9f5f8e550b3319e0f06984e91410789 Mon Sep 17 00:00:00 2001 From: tdtrask Date: Wed, 12 Jul 2017 12:26:30 -0400 Subject: [PATCH] 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 --- lib/ansible/modules/packaging/os/apk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/packaging/os/apk.py b/lib/ansible/modules/packaging/os/apk.py index 59425c01cd..2f50ad4a76 100644 --- a/lib/ansible/modules/packaging/os/apk.py +++ b/lib/ansible/modules/packaging/os/apk.py @@ -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)