Fix no valid packages found

The packages argument arrives at install as a one-element tuple with
all packages e.g. packages = ('dm-monitor logmgmt',). When the code
iterates through it to validate the packages, the packages' names are
not split.

This fix gets the elements from the packages tuple and splits it to
get all package names.

Test plan:
PASS 'software deploy start' a patch with more than one package.
PASS 'software deploy start' a patch with one package.
PASS 'software deploy start' a patch with zero package.

Story: 2010867
Task: 50302

Change-Id: I16b4210e8fa9901cc5a75fee219e3e4903ec36da
Signed-off-by: Lindley Werner <Lindley.Vieira@windriver.com>
This commit is contained in:
Lindley Werner
2024-06-10 12:59:29 -03:00
parent 407a3151a5
commit 17bc074e0c

View File

@@ -94,6 +94,8 @@ class Apt:
def check_valid_packages(self, cache, packages):
"""Check for existing package."""
pkgs = []
packages = [pack for item in packages for pack in item.split()]
for package in packages:
if package in cache:
pkg = self.apt_package(cache, package)