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

Facter 4 compatibilty #318

Closed
ekohl opened this issue Mar 19, 2020 · 11 comments
Closed

Facter 4 compatibilty #318

ekohl opened this issue Mar 19, 2020 · 11 comments

Comments

@ekohl
Copy link
Member

ekohl commented Mar 19, 2020

Since Facter 4 was released, it appears the selinux_python_command.rb fact has started to fail when rpm is not present. This happens when running tests on a non-Red Hat OS where rpm is not present:

Error while resolving custom fact fact='selinux_python_command', resolution='': Could not execute 'rpm -q python3-libsemanage'

It looks like Facter::Core::Execution.execute now raises an exception when the command fails where previously it didn't.

@ekohl
Copy link
Member Author

ekohl commented Mar 19, 2020

Looks like this was also an issue in early Facter 2: https://tickets.puppetlabs.com/browse/FACT-409

@alexjfisher
Copy link
Member

ping @IrimieBogdan

@blackknight36
Copy link
Contributor

Are you certain that the confine statement is working? Seems like the exec statement shouldn't be evaluated at all on non-RedHat nodes although you would also run into issues on a RedHat based OS where rpm is not available.

@ekohl
Copy link
Member Author

ekohl commented Mar 19, 2020

Note that this is in CI, which is always a bit different. I suspect the RH facts are loaded on an Ubuntu machine. That might mess up things.

@BogdanIrimie
Copy link

@ekohl thanks for the info, in the next release of Facter 4 (probably tomorrow) this will be fixed. Facter::Core::Execution.execute will no longer throw exception and will log a message if it failed to execute command.

@ekohl
Copy link
Member Author

ekohl commented Mar 19, 2020

Great to hear. I'll revert theforeman/puppet-pulpcore@011f84b to verify it's been fixed.

@BogdanIrimie
Copy link

@ekohl We have identified the problem, when running Facter 4 in a gem context, the exit code should be 0, even if there were errors. There is an experimental fix, but it will not get in today's release. You can expect the fix to get in early next week.

@ekohl
Copy link
Member Author

ekohl commented Mar 20, 2020

Thanks for the update! theforeman/puppet-pulpcore#83 should test that branch.

@ekohl
Copy link
Member Author

ekohl commented Mar 20, 2020

It looks like that passes, but still outputs the error. Now that makes me wonder: were custom facts always executed in CI?

@BogdanIrimie
Copy link

@ekohl a new release of Facter 4 is out https://rubygems.org/gems/facter/versions/4.0.13 Please give it a try.

@ekohl
Copy link
Member Author

ekohl commented Apr 3, 2020

Closing due to the new facter version.

@ekohl ekohl closed this as completed Apr 3, 2020
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

No branches or pull requests

4 participants