Skip to content

Improvements to mysql_grant. #276

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 1 commit into from
Oct 2, 2013
Merged

Improvements to mysql_grant. #276

merged 1 commit into from
Oct 2, 2013

Conversation

apenney
Copy link
Contributor

@apenney apenney commented Sep 24, 2013

Ensure that table and user are required properties, as well as remove
the optional table handling in the provider and enforce it.

Ensure that table and user are required properties, as well as remove
the optional table handling in the provider and enforce it.
@apenney apenney mentioned this pull request Sep 24, 2013
query = "GRANT #{priv_string}"
query << " ON #{table_string}" if table
Copy link
Contributor

Choose a reason for hiding this comment

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

But isn't that if the table is empty or undef that would raise an exception, because it would actually generate grant "priv" ON TO test1@localhost; ? Base on the type definition the table parameter can be easily defined undef.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added:

  • fail('table parameter is required.') if self[:ensure] == :present and self[:table].nil?

Which should stop the table from being blank in the type. Originally I thought it was optional but I believe you always need a table of some kind to issue a grant against. Please correct me if I'm off base but I can't find a time when you can say:

GRANT X TO 'blah'@'blah' without having an ON y.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah that should be OK. Yes you always need some kind of table or reserved sequence sush as ., *, etc and use ON.

apenney pushed a commit that referenced this pull request Oct 2, 2013
@apenney apenney merged commit f8af684 into puppetlabs:master Oct 2, 2013
@apenney apenney deleted the mysql_grant_fixes branch October 2, 2013 16:56
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.

3 participants