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

Check use_ssl is not nil #11

Merged
merged 2 commits into from
Mar 3, 2022
Merged

Check use_ssl is not nil #11

merged 2 commits into from
Mar 3, 2022

Conversation

ryanjbull
Copy link
Contributor

If use_ssl is nil use default otherwise use the param passed in. The old logic would always end up setting use_ssl to being true

If use_ssl is nil use default otherwise use the param passed in. The old logic would always end up setting use_ssl to being true
@ryanjbull ryanjbull requested a review from a team as a code owner March 3, 2022 08:50
@CLAassistant
Copy link

CLAassistant commented Mar 3, 2022

CLA assistant check
All committers have signed the CLA.

@MartyEwings MartyEwings added the bug Something isn't working label Mar 3, 2022
Copy link
Contributor

@MartyEwings MartyEwings left a comment

Choose a reason for hiding this comment

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

@ryanjbull thank you for your input!

Would it be possible to make the small styling change suggested by rubocop:

Offenses:

lib/puppet_x/puppetlabs/influxdb/influxdb.rb:40:43: C: [Correctable] Style/NonNilCheck: Prefer !expression.nil? over expression != nil. (https://rubystyle.guide#no-non-nil-checks)
@use_ssl ||= resource[:use_ssl] != nil ? resource[:use_ssl] : PuppetlabsInfluxdb.use_ssl
^^

24 files inspected, 1 offense detected, 1 offense auto-correctable
Error: exit status 1
Error: Process completed with exit code 1.

@ryanjbull
Copy link
Contributor Author

@MartyEwings hopefully that's better. Ruby is not my strong suite

@MartyEwings
Copy link
Contributor

Author

Looks good to me, and again thank you for your input.

May i direct you to the Puppet development kit, this can help for many of these styling and linting errors:

https://puppet.com/docs/pdk/2.x/pdk.html

for instance, the command "pdk validate -a" will autocorrect many puppet and ruby, styling and syntax errors

@m0dular
Copy link
Contributor

m0dular commented Mar 3, 2022

Thanks for the quick contribution @ryanjbull 👍

@m0dular m0dular merged commit 7a800f3 into puppetlabs:main Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants