lib/facter/custom_facts/util/confine.rb in facter-4.7.0 vs lib/facter/custom_facts/util/confine.rb in facter-4.7.1

- old
+ new

@@ -33,11 +33,11 @@ format("'%<fact>s' '%<values>s'", fact: @fact, values: @values.join(',')) end # Evaluate the fact, returning true or false. - # if we have a block paramter then we only evaluate that instead + # if we have a block parameter then we only evaluate that instead def true? if @block && !@fact begin return !!@block.call rescue StandardError => e @@ -52,12 +52,14 @@ end value = convert(fact.value) return false if value.nil? + # We call the block with both the downcased and raw fact value for + # backwards-compatibility. if @block begin - return !!@block.call(value) + return !!@block.call(value) || !!@block.call(fact.value) # rubocop:disable Style/DoubleNegation rescue StandardError => e log.debug "Confine raised #{e.class} #{e}" return false end end