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

Collectd version fact value #707

Closed
wants to merge 1 commit into from
Closed

Collectd version fact value #707

wants to merge 1 commit into from

Conversation

crigertg
Copy link

@crigertg crigertg commented Nov 3, 2017

fixes issue #700

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

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

I think that in this case it does make sense to return false.

@bastelfreak
Copy link
Member

Strange thing here is that our tests were green before this change, so they didn't detect this error. Conclusion: We don't have a test that proves that this change fixes anything / breaks nothing. In theory the puppetlabs_spec_helper enables STRICT_VARIABLES. It needs to be checked if this is actually the case, or if we need more tests here.

@bastelfreak
Copy link
Member

@ctriegg cna you also please check the used email address in your commit? It isn't associated with your github account.

@ekohl
Copy link
Member

ekohl commented Nov 4, 2017

@bastelfreak we ensure the fact is present in our tests:

collectd_version: '5.5.0'

@alexjfisher
Copy link
Member

I'm not sure this is the right fix. As per our own docs, we shouldn't be using top scope variables to access facts.

I think changing init.pp line 37

collectd_version_real = pick($::collectd_version, $minimum_version)

to

collectd_version_real = pick_default($facts['collectd_version'], $minimum_version)

would be better.

@alexjfisher
Copy link
Member

Actually, I think this isn't just a style thing. This PR introduces a bug.
collectd_version_real should equal minimum_version if the fact isn't available, not false.

Copy link
Member

@alexjfisher alexjfisher left a comment

Choose a reason for hiding this comment

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

This PR breaks the minimum_version parameter.

@crigertg
Copy link
Author

crigertg commented Nov 6, 2017

alexjfisher is right.
adapting pick to pick_default is the better solution.

just running tests, pushing it when they're finished

@alexjfisher
Copy link
Member

@ctriegg I've already got #708 open (which includes a similar fix for python_dir)

@crigertg crigertg closed this Nov 6, 2017
@alexjfisher
Copy link
Member

@ctriegg Thank you for looking into this.

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

5 participants