Skip to content

Commit

Permalink
(maint) Silent solaris_zones facts on FreeBSD
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
smortex committed Jul 2, 2020
1 parent 35ce8e2 commit db0756f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/facts/freebsd/solaris_zones/current.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

module Facts
module Freebsd
module SolarisZones
class Current
FACT_NAME = 'solaris_zones.current'

def call_the_resolver
[]
end
end
end
end
end
15 changes: 15 additions & 0 deletions lib/facts/freebsd/solaris_zones/zone.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

module Facts
module Freebsd
module SolarisZones
class Zone
FACT_NAME = 'solaris_zones.zones'

def call_the_resolver
[]
end
end
end
end
end

0 comments on commit db0756f

Please sign in to comment.