From 283d1bf93356aa832c74ded2073bcf232eaeec32 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Mon, 7 Aug 2023 13:51:22 +0200 Subject: [PATCH] Simplify confine statement --- lib/puppet/provider/service/init.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/puppet/provider/service/init.rb b/lib/puppet/provider/service/init.rb index 0894dc68838..67579beee1a 100644 --- a/lib/puppet/provider/service/init.rb +++ b/lib/puppet/provider/service/init.rb @@ -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