Skip to content

(MODULES-4604) move name validation in mysql_grant type #961

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
Jun 27, 2017

Conversation

eputnam
Copy link
Contributor

@eputnam eputnam commented Jun 27, 2017

Users are running into an issue where `puppet resource mysql_grant` fails because there is a global name validation using properties that only exist in a compiled catalog and not in the naked type that is instantiated during a `puppet resource` run. self[:user] and self[:table] are nil in this use case so there is a failure. This commit surrounds the validation in an if statement so it is not called during `puppet resource`. Also, a happy path test is added and the acceptance test is removed."

@eputnam eputnam changed the title (MODULES-4896) move name validation in mysql_grant type (MODULES-4604) move name validation in mysql_grant type Jun 27, 2017
@eputnam eputnam force-pushed the MODULES-4896 branch 3 times, most recently from 51b3c4b to bbf24b4 Compare June 27, 2017 22:04
Users are running into an issue where \`puppet resource mysql_grant\` fails because there is a global name validation using properties that only exist in a compiled catalog and not in the naked type that is instantiated during a \`puppet resource\` run. self[:user] and self[:table] are nil in this use case so there is a failure. This commit surrounds the validation in an if statement so it is not called during \`puppet resource\`. Also, a happy path test is added and the acceptance test is removed."
@hunner hunner merged commit 842916c into puppetlabs:master Jun 27, 2017
hunner added a commit that referenced this pull request Jun 27, 2017
(MODULES-4604) move name validation in mysql_grant type
@LichP
Copy link

LichP commented Jan 28, 2018

This validation still erroneously fails if user is passed in as an uninterpolated variable. For example:

$user_host = 'someuser@somehost'
$db_name = 'somedb'
mysql_grant { "${user_host}/${db_name}.*":
  ensure     => present,
  privileges => $tables_or_all,
  table      => "${db_name}.*",
  user       => $user_host,
}

The above snippet fails the validation check on 5.2.0 unless the user line is changed to user => "${user_host}",

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.

4 participants