diff --git a/changelogs/fragments/apk_package_facts.yml b/changelogs/fragments/apk_package_facts.yml new file mode 100644 index 00000000000000..6eb1a351625e70 --- /dev/null +++ b/changelogs/fragments/apk_package_facts.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - package_facts - apk fix when cache is empty (https://github.com/ansible/ansible/issues/83126). diff --git a/lib/ansible/modules/package_facts.py b/lib/ansible/modules/package_facts.py index 370e7d60b447d1..db7170f271673c 100644 --- a/lib/ansible/modules/package_facts.py +++ b/lib/ansible/modules/package_facts.py @@ -460,7 +460,7 @@ class APK(CLIMgr): def list_installed(self): rc, out, err = module.run_command([self._cli, 'info', '-v']) - if rc != 0 or err: + if rc != 0: raise Exception("Unable to list packages rc=%s : %s" % (rc, err)) return out.splitlines()