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

Fix for issue 185. #186

Merged
merged 1 commit into from May 28, 2015
Merged

Fix for issue 185. #186

merged 1 commit into from May 28, 2015

Conversation

krancour
Copy link
Contributor

This will recompile the catalog when a different :hiera_config value is detected (much the same as is done when different facter facts are used). When this condition is detected, Puppet's internally cached instance of Hiera is also cleared so that the catalog can be recompiled against the differently configured Hiera.

…hiera_config value is detected (much the same as is done when different facter facts are used). When this condition is detected, Puppet's internally cached instande of Hiera is also cleared so that the catalog can be recompiled agsint the differently configured Hiera.
@daenney
Copy link
Contributor

daenney commented Apr 1, 2014

Looks like the tests broke because of the new Rake minor release that dropped a Ruby version. Those that didn't break are all green though.

So 👍.

catalogue = build_catalog(node_name, facts_hash(node_name), code)
hiera_config_value = self.respond_to?(:hiera_config) ? hiera_config : nil

catalogue = build_catalog(node_name, facts_hash(node_name), hiera_config_value, code)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't understand why these two lines have been added... Could you help me understand?

It seems like hiera_config_value is never actually used in the build_catalog_without_cache method.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The trick seems to be that adding the configuration as additional argument will change the cache key used in build_catalog(). Without this, the cached catalog is returned unchanged.

@jeffmccune
Copy link
Collaborator

I've gotta think on this one a bit longer before I merge it in... I'm interested in trying to get something a bit more "clean" from an interface or API point of view.

@DavidS
Copy link
Collaborator

DavidS commented May 27, 2015

I could reproduce the problem local, setting :hiera_config seems to leak across specs. I can also attest to the fact that the fix works for me with puppet 3.8.1 and puppet 4.

Moving the second chunk to before_each_test() works, but still requires the first chunk to get the local caching right.

@jeffmccune jeffmccune merged commit 9f8cff5 into rodjek:master May 28, 2015
@krancour krancour deleted the issue-185-fix branch February 4, 2016 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants