Skip to content

Commit

Permalink
(PUP-11430) replace legacy facts in service provider
Browse files Browse the repository at this point in the history
This causes issues with spec testing puppet modules on a regular basis.
It's not guaranteed that new factsets from facterdb have legacy facts
because, well, Puppet Inc declared them legacy and in many places they
are opt-in. We (Vox Pupuli) spent alot of time adding some legacy facts
back to some factsets, but it's inconsistent. I think they shouldn't be
used anymore.
  • Loading branch information
bastelfreak committed Jan 28, 2022
1 parent 4772afa commit 0f9f09e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/puppet/provider/service/init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
desc "Standard `init`-style service management."

def self.defpath
case Puppet.runtime[:facter].value(:operatingsystem)
case Puppet.runtime[:facter].value(:os)['name']
when "FreeBSD", "DragonFly"
["/etc/rc.d", "/usr/local/etc/rc.d"]
when "HP-UX"
Expand All @@ -21,8 +21,8 @@ def self.defpath
# Debian and Ubuntu should use the Debian provider.
# 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 = Puppet.runtime[:facter].value(:os)['name'].downcase
family = Puppet.runtime[:facter].value(:os)['family'].downcase
!(os == 'debian' || os == 'ubuntu' || family == 'redhat')
end

Expand Down

0 comments on commit 0f9f09e

Please sign in to comment.