Skip to content

Commit bc1f80c

Browse files
committed
Switch from puppet releases to openvox releases
1 parent fdb3446 commit bc1f80c

File tree

5 files changed

+35
-142
lines changed

5 files changed

+35
-142
lines changed

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -572,9 +572,15 @@ When no facts are available for the specific facter/operating system combination
572572
## Maintenance
573573

574574
This gem uses information about puppet AIO component versions to build/test.
575-
They are stored at `ext/puppet_agent_facter_versions.json`. If they are outdated,
576-
the `puppet_versions:test` rake task will fail and they need to be updated.
577-
This is as easy as running: `bundle exec rake puppet_versions:update`
575+
They are stored at `ext/puppet_agent_facter_versions.json`.
576+
577+
In the past we used `bundle exec rake puppet_versions:update` to update the file and `puppet_versions:test` to validate it.
578+
This relied on information from the puppet forge.
579+
With the 6.0.0 release we're switching to openvox.
580+
The file is currently maintained by hand, because openvox doesn't offer an API yet to map agent releases to openfact releases.
581+
It got also renamed from `ext/puppet_agent_facter_versions.json` -> `ext/openvox_agent_facter_versions.json`.
582+
583+
**`ext/openvox_agent_facter_versions.json`now lists a mapping of openvox releases to openfact releases**
578584

579585
## License
580586

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"8.23.1": "5.1.0",
3+
"8.23.0": "5.1.0",
4+
"8.22.1": "5.0.0",
5+
"8.19.2": "4.11.0",
6+
"8.19.1": "4.11.0",
7+
"8.19.0": "4.11.0",
8+
"8.18.1": "4.11.0",
9+
"8.17.0": "4.11.0",
10+
"8.16.0": "4.11.0",
11+
"8.15.0": "4.11.0",
12+
"8.14.0": "4.11.0",
13+
"8.13.0": "4.11.0",
14+
"8.12.1": "4.11.0",
15+
"8.12.0": "4.11.0",
16+
"8.11.0": "4.11.0"
17+
}

ext/puppet_agent_facter_versions.json

Lines changed: 0 additions & 133 deletions
This file was deleted.

lib/rspec-puppet-facts.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ def self.facter_version_to_loose_requirement_string(version)
403403
def self.facter_version_for_puppet_version(puppet_version)
404404
return Facter.version if puppet_version.nil?
405405

406-
json_path = File.expand_path(File.join(__dir__, '..', 'ext', 'puppet_agent_facter_versions.json'))
406+
json_path = File.expand_path(File.join(__dir__, '..', 'ext', 'openvox_agent_facter_versions.json'))
407407
unless File.file?(json_path) && File.readable?(json_path)
408408
warning "#{json_path} does not exist or is not readable, defaulting to Facter #{Facter.version}"
409409
return Facter.version

spec/rspec_puppet_facts_spec.rb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
end
2222

2323
let(:component_json_path) do
24-
File.expand_path(File.join(__dir__, '..', 'ext', 'puppet_agent_facter_versions.json'))
24+
File.expand_path(File.join(__dir__, '..', 'ext', 'openvox_agent_facter_versions.json'))
2525
end
2626

2727
let(:puppet_version) { Puppet.version }
@@ -98,18 +98,21 @@
9898
end
9999

100100
context 'when passed a known Puppet version' do
101-
let(:puppet_version) { '5.2.0' }
101+
let(:puppet_version) { '8.11.0' }
102102

103103
it 'returns the Facter version for that Puppet version' do
104-
expect(facter_version).to eq('3.9.0')
104+
expect(facter_version).to eq('4.11.0')
105105
end
106106
end
107107

108108
context 'when passed a Puppet version between two known versions' do
109-
let(:puppet_version) { '5.2.5' }
109+
# openvox 8.19.0 has facter 4.11.0
110+
# openvox 8.22.1 has openfact 5.0.0
111+
# openvox 9.18.5 doesn't exist
112+
let(:puppet_version) { '8.19.5' }
110113

111114
it 'returns the Facter version for the lower Puppet version' do
112-
expect(facter_version).to eq('3.9.0')
115+
expect(facter_version).to eq('4.11.0')
113116
end
114117
end
115118

0 commit comments

Comments
 (0)