Skip to content

Commit 283d1bf

Browse files
committed
Simplify confine statement
1 parent 9c6ce9c commit 283d1bf

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
@@ -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')
26-
family = Puppet.runtime[:facter].value('os.family')
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)