Skip to content

Commit 7ca202b

Browse files
authored
Merge pull request #9082 from ekohl/avoid-downcase
Avoid downcasing facts in service provider
2 parents 682d101 + 283d1bf commit 7ca202b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Diff for: lib/puppet/provider/service/init.rb

+2-5
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,9 @@ def self.defpath
2020
end
2121

2222
# Debian and Ubuntu should use the Debian provider.
23+
confine :false => ['Debian', 'Ubuntu'].include?(Puppet.runtime[:facter].value('os.name'))
2324
# RedHat systems should use the RedHat provider.
24-
confine :true => begin
25-
os = Puppet.runtime[:facter].value('os.name').downcase
26-
family = Puppet.runtime[:facter].value('os.family').downcase
27-
!(os == 'debian' || os == 'ubuntu' || family == 'redhat')
28-
end
25+
confine :false => Puppet.runtime[:facter].value('os.family') == 'RedHat'
2926

3027
# We can't confine this here, because the init path can be overridden.
3128
#confine :exists => defpath

0 commit comments

Comments
 (0)