Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Print an error message when module to be created doesn't exist #218

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

spetrosi
Copy link
Contributor

@spetrosi spetrosi commented Dec 8, 2023

Enhancement: Print an error message when module to be created doesn't exist

Reason: When specifying a non-existent file with selinux_modules.path the role fails with an informative message that the module file that you try to install doesn't exist.

when: not module_file.stat.checksum in checksum
when: >-
(not module_file.stat.exists) or
(module_file.stat.exists and not module_file.stat.checksum in checksum)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while this seems correct, unfortunately it will break https://github.com/linux-system-roles/selinux/blob/main/tests/tests_selinux_modules.yml#L149 because an error won't be raised by this code. I think we should not fix this. Or, if we do, we need to figure out if it is ok to always raise an error if not module_file.stat.exists

@spetrosi spetrosi changed the title fix: Fix installing selinux modules fix: Print an error message when module to be created doesn't exist Dec 8, 2023
@richm
Copy link
Contributor

richm commented Dec 8, 2023

[citest]

@@ -26,6 +26,11 @@
delegate_to: localhost
become: false

- name: Raise an error when module file doesn't exist
fail:
msg: The module that you try to install doesn't exist in {{ item.path }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
msg: The module that you try to install doesn't exist in {{ item.path }}
msg: The module that you try to install doesn't exist in {{ __selinux_item.path }}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because #217 merged

@richm
Copy link
Contributor

richm commented Dec 8, 2023

[citest]

@richm
Copy link
Contributor

richm commented Dec 8, 2023

the rhel6 and 7 failures are known and seen occasionally
the fedora 39 error looks odd, possibly transient - I don't see it locally

@richm richm merged commit bf0d6ba into linux-system-roles:main Dec 8, 2023
28 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants