From: Jonathan Tripathy Date: Tue, 9 Feb 2016 16:11:40 +0000 (+0000) Subject: (MODULES 3932) - We need to call Facter.flush to clear Facter cache to X-Git-Tag: 1.8.0~5^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=42c0e7f25d87a506f3cd6caae59201dea41ca8ef;p=puppet-modules%2Fpuppetlabs-firewall.git (MODULES 3932) - We need to call Facter.flush to clear Facter cache to get up to date value for :iptables_persistent_version. --- diff --git a/lib/puppet/util/firewall.rb b/lib/puppet/util/firewall.rb index 9e77e15..8acbd46 100644 --- a/lib/puppet/util/firewall.rb +++ b/lib/puppet/util/firewall.rb @@ -160,6 +160,9 @@ module Puppet::Util::Firewall # Older iptables-persistent doesn't provide save action. if os_key == 'Debian' + # We need to call Facter.flush to clear Facter cache as it's possible the cached value will be nil due to the fact + # that the iptables-persistent package was potentially installed after the initial Fact gathering. + Facter.flush persist_ver = Facter.value(:iptables_persistent_version) if (persist_ver and Puppet::Util::Package.versioncmp(persist_ver, '0.5.0') < 0) os_key = 'Debian_manual'