Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(MODULES 3932) - We need to call Facter.flush to clear Facter cache #603

Merged
merged 1 commit into from
Feb 9, 2016

Conversation

jonnytdevops
Copy link
Contributor

We need to call Facter.flush to clear Facter cache to get up to date value for :iptables_persistent_version.

get up to date value for :iptables_persistent_version.
@tphoney
Copy link
Contributor

tphoney commented Feb 9, 2016

@DavidS @hunner is this done in other modules ?

@hunner
Copy link
Contributor

hunner commented Feb 9, 2016

It's not, but it sounds valid to me. 👍

hunner added a commit that referenced this pull request Feb 9, 2016
(MODULES 3932) - We need to call Facter.flush to clear Facter cache
@hunner hunner merged commit e1892f8 into puppetlabs:master Feb 9, 2016
@@ -160,6 +160,9 @@ def persist_iptables(proto)

# 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than flushing all facts, this could potentially be more specific with Facter.fact(:iptables_persistent_version).flush, assuming this fact doesn't depend on cached data that is also out of date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants