Skip to content

Commit d231c60

Browse files
committed
Simplify confine statement in init service provider
Rather than using a single complex statement, this uses multiple confine statements.
1 parent 4dc7185 commit d231c60

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/puppet/provider/service/init.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@ def self.defpath
1919
end
2020

2121
# Debian and Ubuntu should use the Debian provider.
22+
confine :false => ['Debian', 'Ubuntu'].include?(Puppet.runtime[:facter].value('operatingsystem'))
2223
# RedHat systems should use the RedHat provider.
23-
confine :true => begin
24-
os = Puppet.runtime[:facter].value(:operatingsystem)
25-
family = Puppet.runtime[:facter].value(:osfamily)
26-
!(os == 'Debian' || os == 'Ubuntu' || family == 'RedHat')
27-
end
24+
confine :false => Puppet.runtime[:facter].value('osfamily') == 'RedHat'
2825

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

0 commit comments

Comments
 (0)