]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
(MODULES 3932) - We need to call Facter.flush to clear Facter cache to
authorJonathan Tripathy <jt@puppetlabs.com>
Tue, 9 Feb 2016 16:11:40 +0000 (16:11 +0000)
committerJonathan Tripathy <jt@puppetlabs.com>
Tue, 9 Feb 2016 16:11:40 +0000 (16:11 +0000)
get up to date value for :iptables_persistent_version.

lib/puppet/util/firewall.rb

index 9e77e1507828f83379c0bc094472d8d5e66b0ecf..8acbd469ed50974dcd73f03afa3343b463cdcbc8 100644 (file)
@@ -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'