-
Notifications
You must be signed in to change notification settings - Fork 794
(MODULES-5618) Hide logging of password_hash changes in mysql::user #993
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
Conversation
Hey @jhriggs, thanks for this pull request! One thing I noticed is that the rubocop job is failing for a few reasons (you can see the full output of that here). If you wouldn't mind addressing those it'd be greatly appreciated as it helps keep our code tidy and consistent. Plus it does look like the methods you added take a variable that they're not using? Let me know if you have any further questions! |
Updated. For consistency, I had literally copied the code from Puppet's |
The last remaining "offense" in Rubocop cannot be "fixed". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix Robocop error
def change_to_s(currentvalue, _newvalue) | ||
(currentvalue == :absent) ? 'created password' : 'changed password' | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on Robocop - PredicateName you cannot use is_
, you can fix it by disable Style/PredicateName
and enable it after is_to_s
.
For example:
# rubocop:disable Style/PredicateName
def is_to_s(_currentvalue)
'[old password hash redacted]'
end
# rubocop:enable Style/PredicateName
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This look's good. As a note for the future though you can put the disable on the line that violates the rule itself. This will make it only disable for that line. It's only if it is placed on an empty line that it need's to be reenabled.
No description provided.