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

Remove use of legacy facts #93

Merged

Conversation

alexjfisher
Copy link
Member

At some point soon, either facterdb will stop providing legacy facts or rspec-puppet-facts will be configurable to filter them out. Either way, we should not rely on them in this gem and use the modern counterparts instead.

@alexjfisher alexjfisher force-pushed the remove_use_of_legacy_facts branch from 0885da0 to 230ef78 Compare March 14, 2023 12:22
@@ -71,7 +71,7 @@ def add_stdlib_facts
# Rough conversion of grepping in the puppet source:
# grep defaultfor lib/puppet/provider/service/*.rb
add_custom_fact :service_provider, ->(os, facts) do
case facts[:osfamily].downcase
case facts[:os]['family'].downcase
Copy link
Member

Choose a reason for hiding this comment

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

I'd like to respect RSpec.configuration.facterdb_string_keys from rspec-puppet-facts:

Suggested change
case facts[:os]['family'].downcase
os = RSpec.configuration.facterdb_string_keys ? facts['os'] : facts[:os]
case os['family'].downcase

And change the fact below as well.

Then we're ready for changing that default in the future.

At some point soon, either facterdb will stop providing legacy facts or
rspec-puppet-facts will be configurable to filter them out.  Either way,
we should not rely on them in this gem and use the modern counterparts
instead.
@alexjfisher alexjfisher force-pushed the remove_use_of_legacy_facts branch from 230ef78 to d6eb991 Compare March 14, 2023 13:37
Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

Thanks!

@alexjfisher alexjfisher merged commit 0aa95ac into voxpupuli:master Mar 14, 2023
@alexjfisher alexjfisher deleted the remove_use_of_legacy_facts branch March 14, 2023 21:24
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.

3 participants