mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-28 07:31:23 -07:00
[PR #10442/3ad57ffa backport][stable-10] Ensure apk handles empty name strings properly (#10477)
Ensure apk handles empty name strings properly (#10442)
* Ensure apk handles empty name strings
* Update changelog
* Update tests/integration/targets/apk/tasks/main.yml
* Update changelogs/fragments/10442-apk-fix-empty-names.yml
* Remove redundant conditional
* Remove redundant ignore errors
* Reject apk with update cache for empty package names
---------
(cherry picked from commit 3ad57ffa67
)
Co-authored-by: Giorgos Drosos <56369797+gdrosos@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
4c1077b2a0
commit
374270d242
3 changed files with 66 additions and 0 deletions
|
@ -351,6 +351,9 @@ def main():
|
|||
|
||||
p = module.params
|
||||
|
||||
if all(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']:
|
||||
APK_PATH = "%s --no-cache" % (APK_PATH, )
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue