check-language-support: fix empty pkg list

The check-language-support on my machine was providing a single empty
newline as output, and the length check isn't catching that as the
resulting packages array has a value of [''].
Drop empty values from the list to avoid a "KeyError: ''" exception.
This commit is contained in:
Dan Bungert 2021-11-16 18:47:04 -07:00
parent dde0a6d53c
commit 1eefb7a9e5
1 changed files with 1 additions and 1 deletions

View File

@ -142,7 +142,7 @@ class ConfigureController(SubiquityController):
cp.args, cp.returncode)
return False
packages = cp.stdout.strip('\n').split(' ')
packages = [pkg for pkg in cp.stdout.strip().split(' ') if pkg]
if len(packages) == 0:
log.debug("%s didn't recommend any packages. Nothing to do.",
clsCommand)