Skip to content

Commit

Permalink
Merge pull request #9147 from ekohl/7.x-avoid-downcase
Browse files Browse the repository at this point in the history
[7.x] Avoid downcasing facts in service provider
  • Loading branch information
joshcooper authored Nov 15, 2023
2 parents 1145d44 + d231c60 commit d5a4b2a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/puppet/provider/service/init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@ def self.defpath
end

# Debian and Ubuntu should use the Debian provider.
confine :false => ['Debian', 'Ubuntu'].include?(Puppet.runtime[:facter].value('operatingsystem'))
# RedHat systems should use the RedHat provider.
confine :true => begin
os = Puppet.runtime[:facter].value(:operatingsystem).downcase
family = Puppet.runtime[:facter].value(:osfamily).downcase
!(os == 'debian' || os == 'ubuntu' || family == 'redhat')
end
confine :false => Puppet.runtime[:facter].value('osfamily') == 'RedHat'

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

0 comments on commit d5a4b2a

Please sign in to comment.