Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' of github.com:puppetlabs/facter-ng
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Filipovici committed May 29, 2020
2 parents ef96d6b + a0c554c commit fef475f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@


## [4.0.25](https://github.com/puppetlabs/facter-ng/tree/4.0.25) (2020-05-29)

[Full Changelog](https://github.com/puppetlabs/facter-ng/compare/4.0.24...4.0.25)

### Fixed

- \(FACT-2636\) Set external as fact\_type for environment variable facts. [\#537](https://github.com/puppetlabs/facter-ng/pull/537) ([IrimieBogdan](https://github.com/IrimieBogdan))



## [4.0.24](https://github.com/puppetlabs/facter-ng/tree/4.0.24) (2020-05-26)

[Full Changelog](https://github.com/puppetlabs/facter-ng/compare/4.0.23...4.0.24)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0.24
4.0.25
2 changes: 1 addition & 1 deletion lib/custom_facts/util/loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def load_env(fact = nil)
# match it.
next if fact && (env_name != fact)

LegacyFacter.add(Regexp.last_match(1)) do
LegacyFacter.add(Regexp.last_match(1), fact_type: :external) do
has_weight 1_000_000
setcode { value }
end
Expand Down
5 changes: 3 additions & 2 deletions spec/custom_facts/util/loader_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,11 @@ def loader_from(places)
describe 'when loading facts' do
it 'loads values from the matching environment variable if one is present' do
loader = loader_from(env: { 'facter_testing' => 'yayness' })

expect(LegacyFacter).to receive(:add).with('testing')
allow(LegacyFacter).to receive(:add)

loader.load(:testing)

expect(LegacyFacter).to have_received(:add).with('testing', { fact_type: :external })
end

it 'loads any files in the search path with names matching the fact name' do
Expand Down

0 comments on commit fef475f

Please sign in to comment.