Skip to content

Commit

Permalink
Merge pull request #2601 from cthorn42/bug_fix/main/FACT-3422_fix_sle…
Browse files Browse the repository at this point in the history
…s_sap_os_distro

(FACT-3422) Fix SLES SAP use of os distro
  • Loading branch information
joshcooper authored Aug 15, 2023
2 parents af7272b + 436f968 commit 0b0b988
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/facter/resolvers/os_release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def process_version_id
def process_id
return unless @fact_list[:id]

@fact_list[:id] = 'sles' if /sles_sap/i.match?(@fact_list[:id])
@fact_list[:id] = 'opensuse' if /opensuse/i.match?(@fact_list[:id])
end

Expand Down
6 changes: 6 additions & 0 deletions spec/facter/resolvers/os_release_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@

expect(result).to eq('SLES')
end

it 'returns os ID' do
result = Facter::Resolvers::OsRelease.resolve(:id)

expect(result).to eq('sles')
end
end

context 'when on Manjarolinux' do
Expand Down

0 comments on commit 0b0b988

Please sign in to comment.