This commit is contained in:
Adam Miller 2023-11-16 05:00:42 +00:00 committed by GitHub
commit bb74d3295d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,7 +77,7 @@ from ansible.module_utils._text import to_text
def locally_installed(module, pkgname): def locally_installed(module, pkgname):
(rc, out, err) = module.run_command('{0} -q {1}'.format(module.get_bin_path("rpm"), pkgname).split()) (rc, _, _) = module.run_command('{0} -q --whatprovides {1}'.format(module.get_bin_path("rpm"), pkgname).split())
return (rc == 0) return (rc == 0)
@ -97,9 +97,9 @@ def rpm_ostree_transaction(module):
module.exit_json(msg="No changes made.") module.exit_json(msg="No changes made.")
else: else:
if module.params['state'] in ['present', 'installed', 'latest']: if module.params['state'] in ['present', 'installed', 'latest']:
module.fail_json(msg="The following packages are absent in the currently booted rpm-ostree commit: %s" ' '.join(pkgs)) module.fail_json(msg="The following packages are absent in the currently booted rpm-ostree commit: {}".format(' '.join(pkgs)))
else: else:
module.fail_json(msg="The following packages are present in the currently booted rpm-ostree commit: %s" ' '.join(pkgs)) module.fail_json(msg="The following packages are present in the currently booted rpm-ostree commit: {}".format(' '.join(pkgs)))
def main(): def main():