Skip to content

Commit

Permalink
Simplify confine statement
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Aug 7, 2023
1 parent 9c6ce9c commit 283d1bf
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 @@ -20,12 +20,9 @@ def self.defpath
end

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

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

0 comments on commit 283d1bf

Please sign in to comment.