Skip to content

Commit

Permalink
Fix use of legacy facts
Browse files Browse the repository at this point in the history
Fixes #90
  • Loading branch information
silug committed Nov 26, 2024
1 parent 391e05b commit fa5c874
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* Mon Nov 25 2024 Steven Pritchard <steve@sicura-us> - 9.5.1
- Fix use of legacy facts

* Mon Oct 23 2023 Steven Pritchard <[email protected]> - 9.5.0
- [puppetsync] Add EL9 support

Expand Down
4 changes: 2 additions & 2 deletions SIMP/compliance_profiles/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,5 @@ checks:
- SRG-OS-000030-GPOS-00010
- SRG-OS-000480-GPOS-00227
confine:
osfamily: RedHat
operatingsystemmajrelease: '7'
os.family: RedHat
os.release.major: '7'
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simp-gnome",
"version": "9.5.0",
"version": "9.5.1",
"author": "SIMP Team",
"summary": "Provides useful settings to set up the GNOME desktop environment",
"license": "Apache-2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
profile_path = File.join(
fixtures_path,
'inspec_profiles',
"#{fact_on(host, 'operatingsystem')}-#{fact_on(host, 'operatingsystemmajrelease')}-#{profile}"
"#{fact_on(host, 'os.name')}-#{fact_on(host, 'os.release.major')}-#{profile}"
)

unless File.exist?(profile_path)
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/compliance_engine/compliance_engine_enforce_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

on_supported_os.each do |os, os_facts|
context "on #{os}" do
if valid_systems[os_facts[:operatingsystem]] && (os_facts[:operatingsystemmajrelease] == valid_systems[os_facts[:operatingsystem]])
if valid_systems[os_facts[:os][:name]] && (os_facts[:os][:release][:major] == valid_systems[os_facts[:os][:name]])
compliance_profiles.each do |target_profile|
context "with compliance profile '#{target_profile}'" do
let(:facts){
Expand Down Expand Up @@ -123,7 +123,7 @@
end
else
it 'should be on an OS with compliance engine data' do
skip "#{os_facts[:operatingsystem]} #{os_facts[:operatingsystemmajrelease]} does not have any compliance engine data"
skip "#{os_facts[:os][:name]} #{os_facts[:os][:release][:major]} does not have any compliance engine data"
end
end
end
Expand Down

0 comments on commit fa5c874

Please sign in to comment.