Compare commits

...

3 commits

Author SHA1 Message Date
Adam Miller
9d735fd6d7
Merge da6c259fdd into 2c52f969e1 2023-12-08 11:36:53 -06:00
Adam Miller
da6c259fdd make sanity tests happy
Signed-off-by: Adam Miller <admiller@redhat.com>
2023-12-08 09:52:15 -06:00
Adam Miller
4537dbb7de Honor rpm aliases with whatprovides
Fixes #494

When using an rpm-ostree based system, the rhel_rpm_ostree module needs
to honor rpm aliases. Using whatprovides in the query honors that.

Fix error output formatting for rhel_rpm_ostree

Signed-off-by: Adam Miller <admiller@redhat.com>
2023-12-08 09:52:15 -06:00

View file

@ -77,7 +77,7 @@ from ansible.module_utils._text import to_text
def locally_installed(module, pkgname):
(rc, out, err) = module.run_command('{0} -q {1}'.format(module.get_bin_path("rpm"), pkgname).split())
(rc, stdout, stderr) = module.run_command('{0} -q --whatprovides {1}'.format(module.get_bin_path("rpm"), pkgname).split())
return (rc == 0)
@ -97,9 +97,9 @@ def rpm_ostree_transaction(module):
module.exit_json(msg="No changes made.")
else:
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:
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():