apk: fix empty/whitespace-only package name check (#10532)

* Fix empty/whitespace-only package name check.

* Adjust test.
This commit is contained in:
Felix Fontein 2025-08-02 16:41:24 +02:00 committed by GitHub
commit abfe1e6180
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 5 deletions

View file

@ -351,7 +351,7 @@ def main():
p = module.params
if all(not name.strip() for name in p['name']):
if p['name'] and any(not name.strip() for name in p['name']):
module.fail_json(msg="Package name(s) cannot be empty or whitespace-only")
if p['no_cache']: