Skip to content
This repository has been archived by the owner on Feb 4, 2020. It is now read-only.

Avoid puppet to fail when uchiwa::api is not defined and fix JSON indentation issues #19

Closed
wants to merge 2 commits into from

Conversation

queeno
Copy link
Contributor

@queeno queeno commented Nov 7, 2014

After including puppet-uchiwa in my project, I realised that not defining uchiwa::api causes puppet to fail.

uchiwa.json.erb expects @data['api'] to contain a hash. However if uchiwa::api is not defined, @data['api'] will be nil.

Instead of letting puppet fail, I thought I'd be good practice to include default API configuration parameters in the template.

I've also fixed some JSON indentation issues to make uchiwa.json look prettier.

If uchiwa::api is not defined, puppet will fail when parsing the
template because @DaTa['api'] is nil. In case this happens, I believe
it's appropriate printing out default api config, rather than causing a
failure.
The api JSON doesn't indent correctly. This commit fixes the
indentation.
@solarkennedy
Copy link
Contributor

I like the sane defaults. Can you write a test to ensure this works and will continue to work in the future?

@solarkennedy
Copy link
Contributor

This is now obsolete.

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

Successfully merging this pull request may close these issues.

2 participants