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

puppet-lint issues #25

Open
neoice opened this issue Apr 15, 2015 · 3 comments
Open

puppet-lint issues #25

neoice opened this issue Apr 15, 2015 · 3 comments

Comments

@neoice
Copy link
Contributor

neoice commented Apr 15, 2015

these warnings are generated using the Puppet4 recommendations: http://www.camptocamp.com/en/actualite/getting-code-ready-puppet-4/

grafana/manifests/params.pp - WARNING: variable assigned to the empty string on line 23
grafana/manifests/init.pp - WARNING: class inheriting from params class on line 92

I believe this is a false-positive warning and may be entirely obviated by the next major release...

using a declaration like the following (taken from the README):

class { 'grafana':
  install_dir  => '/usr/local',
  datasources  => {
    'graphite' => {
      'type'    => 'graphite',
      'url'     => 'http://172.16.0.10',
      'default' => 'true'
    },
    'elasticsearch' => {
      'type'      => 'elasticsearch',
      'url'       => 'http://172.16.0.10:9200',
      'index'     => 'grafana-dash',
      'grafanaDB' => 'true',
    },
  }
}

Puppet-Lint warns: "[quoted_booleans] quoted boolean value found" for the 'default' => 'true' and 'grafanaDB' => 'true' lines. I suspect this is a false-positive because these are strings being interpreted later.

@bfraser
Copy link
Owner

bfraser commented Apr 17, 2015

Hi @neoice thanks for opening this. Let me address your points in turn.

grafana/manifests/params.pp - WARNING: variable assigned to the empty string on line 23

I'm not overly concerned with this one as there is no logic wrapped around whether the admin password is an empty string, instead it's just a straight substitution in config.js.

grafana/manifests/init.pp - WARNING: class inheriting from params class on line 92

This check is only present to ensure backwards compatibility with Puppet <= 2.6.2, and in fact use of a params class for supplying module defaults is accepted per the style guide.

"Class inheritance should only be used for myclass::params parameter defaults. Other use cases can be accomplished through the addition of parameters or conditional logic."

How are you running puppet-lint? This check is specifically disabled in the Rakefile so if you are using bundle exec rake test the lint checks will pass.

[quoted_booleans] quoted boolean value found

You are correct this is a false-positive, however unquoting the boolean does not impact functionality and in fact the default datasource configuration was corrected in a recent commit. The README should be updated to reflect this.

Thanks!

@bfraser
Copy link
Owner

bfraser commented Apr 23, 2015

@neoice I've published a new version of the module supporting Grafana 2.x and don't feel there's anything here left to action as the module's behavior has changed. Thoughts?

@dhoppe
Copy link

dhoppe commented Dec 7, 2016

I think this has been fixed by voxpupuli#1.

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

No branches or pull requests

3 participants