Skip to content

Commit 83ac46d

Browse files
authored
Merge pull request #2572 from AriaXLi/FACT-3180
(FACT-3180) Correct Oracle Linux OS behavior
2 parents 5e227d7 + 73b69c1 commit 83ac46d

File tree

5 files changed

+74
-0
lines changed

5 files changed

+74
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# frozen_string_literal: true
2+
3+
module Facts
4+
module Ol
5+
class Lsbdistdescription
6+
FACT_NAME = 'lsbdistdescription'
7+
TYPE = :legacy
8+
9+
def call_the_resolver
10+
fact_value = Facter::Resolvers::LsbRelease.resolve(:description)
11+
12+
Facter::ResolvedFact.new(FACT_NAME, fact_value, :legacy)
13+
end
14+
end
15+
end
16+
end

lib/facter/facts/ol/lsbdistid.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# frozen_string_literal: true
2+
3+
module Facts
4+
module Ol
5+
class Lsbdistid
6+
FACT_NAME = 'lsbdistid'
7+
TYPE = :legacy
8+
9+
def call_the_resolver
10+
fact_value = Facter::Resolvers::LsbRelease.resolve(:distributor_id)
11+
12+
Facter::ResolvedFact.new(FACT_NAME, fact_value, :legacy)
13+
end
14+
end
15+
end
16+
end
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# frozen_string_literal: true
2+
3+
module Facts
4+
module Ol
5+
module Os
6+
module Distro
7+
class Description
8+
FACT_NAME = 'os.distro.description'
9+
10+
def call_the_resolver
11+
fact_value = Facter::Resolvers::OsRelease.resolve(:pretty_name)
12+
13+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
14+
end
15+
end
16+
end
17+
end
18+
end
19+
end
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# frozen_string_literal: true
2+
3+
module Facts
4+
module Ol
5+
module Os
6+
module Distro
7+
class Id
8+
FACT_NAME = 'os.distro.id'
9+
10+
def call_the_resolver
11+
fact_value = Facter::Resolvers::OsRelease.resolve(:id).capitalize
12+
13+
Facter::ResolvedFact.new(FACT_NAME, fact_value)
14+
end
15+
end
16+
end
17+
end
18+
end
19+
end

lib/facter/framework/core/file_loader.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,10 @@
642642

643643
when 'ol'
644644
require_relative '../../facts/ol/os/release.rb'
645+
require_relative '../../facts/ol/lsbdistdescription.rb'
646+
require_relative '../../facts/ol/lsbdistid.rb'
647+
require_relative '../../facts/ol/os/distro/description.rb'
648+
require_relative '../../facts/ol/os/distro/id.rb'
645649

646650
when 'openwrt'
647651
require_relative '../../facts/openwrt/os/release.rb'

0 commit comments

Comments
 (0)