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 facts gathering #773

Merged
merged 7 commits into from
Sep 8, 2021
Merged

Conversation

smortex
Copy link
Collaborator

@smortex smortex commented Sep 8, 2021

This is a follow-up to #770 which fixed a bunch of issues but there are a few more addressed here:

  • Fix undefined method match?' for nil:NilClass`
  • Use Facter::Core::Execution.execute instead of the deprecated Facter::Core::Execution.exec;
  • Use Facter::Core::Execution.execute instead of the private Facter::Util::Resolution.execute.

Fixes #769
Fixes #771

bastelfreak
bastelfreak previously approved these changes Sep 8, 2021
runejuhl
runejuhl previously approved these changes Sep 8, 2021
bastelfreak
bastelfreak previously approved these changes Sep 8, 2021
The options hash passed to Facter::Core::Execution.execute expect a
`time_limit`, not a `limit`:
https://www.rubydoc.info/gems/facter/Facter/Core/Execution#execute-class_method
When this fact was evaluated, an exception was raised:
Error: Facter: Error while resolving custom fact fact='docker_worker_join_token', resolution='<anonymous>': private method `execute' called for Facter::Util::Resolution:Class

Switch from Facter::Util::Resolution to Facter::Core::Execution and set
a time limit of 90s to match the rest of the file.
This make it easier to debug failing unit tests.
@smortex smortex dismissed stale reviews from bastelfreak and runejuhl via f756598 September 8, 2021 18:03
@smortex smortex force-pushed the fix/check-for-nil-value branch 2 times, most recently from eb8f10c to f756598 Compare September 8, 2021 18:03
@smortex smortex requested review from bastelfreak and removed request for a team September 8, 2021 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants