Skip to content

(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

Merged
merged 4 commits into from
Feb 21, 2018

Conversation

jhriggs
Copy link
Contributor

@jhriggs jhriggs commented Sep 13, 2017

No description provided.

@HAIL9000
Copy link
Contributor

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!

@jhriggs
Copy link
Contributor Author

jhriggs commented Sep 13, 2017

Updated. For consistency, I had literally copied the code from Puppet's lib/puppet/type/user.rb.

@jhriggs
Copy link
Contributor Author

jhriggs commented Sep 13, 2017

The last remaining "offense" in Rubocop cannot be "fixed".

Copy link

@yakirgb yakirgb left a 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

Copy link

@yakirgb yakirgb Sep 14, 2017

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

Copy link
Member

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.

@david22swan david22swan merged commit 2bb3751 into puppetlabs:master Feb 21, 2018
@jhriggs jhriggs deleted the ticket/MODULES-5618 branch February 23, 2018 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants