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

(maint) Silent solaris_zones facts on FreeBSD #1954

Merged
merged 1 commit into from
Jul 7, 2020

Conversation

smortex
Copy link
Contributor

@smortex smortex commented Jul 2, 2020

The FreeBSD platform inherits from the Solaris one, but FreeBSD does not
have zones, and the Solaris resolver will fail on FreeBSD.

[2020-07-02 05:53:23.809860 ] ERROR Facter::InternalFactManager - /usr/home/romain/Projects/facter/lib/resolvers/solaris/solaris_zone_name.rb:19:in `build_current_zone_name_fact'
/usr/home/romain/Projects/facter/lib/resolvers/solaris/solaris_zone_name.rb:12:in `block in post_resolve'
/usr/home/romain/Projects/facter/lib/resolvers/solaris/solaris_zone_name.rb:12:in `fetch'
/usr/home/romain/Projects/facter/lib/resolvers/solaris/solaris_zone_name.rb:12:in `post_resolve'
/usr/home/romain/Projects/facter/lib/resolvers/base_resolver.rb:21:in `block in resolve'
/usr/home/romain/Projects/facter/lib/resolvers/base_resolver.rb:19:in `synchronize'
/usr/home/romain/Projects/facter/lib/resolvers/base_resolver.rb:19:in `resolve'
/usr/home/romain/Projects/facter/lib/facts/solaris/solaris_zones/current.rb:11:in `call_the_resolver'
/usr/home/romain/Projects/facter/lib/framework/core/fact/internal/core_fact.rb:12:in `create'
/usr/home/romain/Projects/facter/lib/framework/core/fact/internal/internal_fact_manager.rb:41:in `block (2 levels) in start_threads'

As a workaround, override the solaris_zones facts with dummy ones on
FreeBSD.

The FreeBSD platform inherits from the Solaris one, but FreeBSD does not
have zones, and the Solaris resolver will fail on FreeBSD.

```
[2020-07-02 05:53:23.809860 ] ERROR Facter::InternalFactManager - /usr/home/romain/Projects/facter/lib/resolvers/solaris/solaris_zone_name.rb:19:in `build_current_zone_name_fact'
/usr/home/romain/Projects/facter/lib/resolvers/solaris/solaris_zone_name.rb:12:in `block in post_resolve'
/usr/home/romain/Projects/facter/lib/resolvers/solaris/solaris_zone_name.rb:12:in `fetch'
/usr/home/romain/Projects/facter/lib/resolvers/solaris/solaris_zone_name.rb:12:in `post_resolve'
/usr/home/romain/Projects/facter/lib/resolvers/base_resolver.rb:21:in `block in resolve'
/usr/home/romain/Projects/facter/lib/resolvers/base_resolver.rb:19:in `synchronize'
/usr/home/romain/Projects/facter/lib/resolvers/base_resolver.rb:19:in `resolve'
/usr/home/romain/Projects/facter/lib/facts/solaris/solaris_zones/current.rb:11:in `call_the_resolver'
/usr/home/romain/Projects/facter/lib/framework/core/fact/internal/core_fact.rb:12:in `create'
/usr/home/romain/Projects/facter/lib/framework/core/fact/internal/internal_fact_manager.rb:41:in `block (2 levels) in start_threads'
```

As a workaround, override the solaris_zones facts with dummy ones on
FreeBSD.
@smortex smortex requested review from a team July 2, 2020 15:58
@puppetlabs-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

1 similar comment
@puppetlabs-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@puppetcla
Copy link

CLA signed by all contributors.

@oanatmaria oanatmaria merged commit 5cbe8f7 into puppetlabs:4.x Jul 7, 2020
@smortex smortex deleted the silent-solaris-zone-on-freebsd branch July 7, 2020 08:50
@oanatmaria oanatmaria added the bug Something isn't working label Jul 8, 2020
@igalic
Copy link

igalic commented Jul 16, 2020

would be nice if we replaced this with freebsd_jails instead, eh?

@smortex
Copy link
Contributor Author

smortex commented Jul 16, 2020

@igalic hehe, yes! This is currently not on my todo list: my aim is to make Facter 4.x a drop-in replacement for Facter 3.x on FreeBSD, and there is still a lot to do (last time I started to work on the networking facts I was 😞 😵 😭 🥴… I should retry 😋)

If you have some time to work on this topic, feel free to mention me: I will be pleased to give a hand if there is something I can do!

@igalic
Copy link

igalic commented Jul 16, 2020

points at 🤱 ⬅️ this is how much time i have had for a year now

I've done something like this, but indirectly with libioc: https://github.com/igalic/puppet-jail/blob/fork/ioc/lib/puppet/provider/jail/libiocage.rb#L23

be i just realise that it would make equal sense to provide all those prefetch resources as facts, too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants