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

Fix: Puppet Unknown variable: 'mysql::params::exec_path' #1378

Merged
merged 1 commit into from
Apr 12, 2021

Conversation

JvGinkel
Copy link
Contributor

No description provided.

@JvGinkel JvGinkel requested a review from a team as a code owner March 31, 2021 10:29
@puppet-community-rangefinder
Copy link

mysql::db is a type

Breaking changes to this file WILL impact these 66 modules (exact match):
Breaking changes to this file MAY impact these 15 modules (near match):

This module is declared in 143 of 576 indexed public Puppetfiles.


These results were generated with Rangefinder, a tool that helps predict the downstream impact of breaking changes to elements used in Puppet modules. You can run this on the command line to get a full report.

Exact matches are those that we can positively identify via namespace and the declaring modules' metadata. Non-namespaced items, such as Puppet 3.x functions, will always be reported as near matches only.

@@ -53,14 +53,20 @@
Enum['absent', 'present'] $ensure = 'present',
$import_timeout = 300,
$import_cat_cmd = 'cat',
$mysql_exec_path = $mysql::params::exec_path,
$mysql_exec_path = undef,
) {
Copy link
Contributor

Choose a reason for hiding this comment

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

To fetch all the parameters from mysql::params you should inherit the params class. Use this line to do this:
inherits mysql::params. If you use this you will don't need to verify if $mysql_exec_path is defined or not.
Please try it and let us know if it's working for you

Copy link
Contributor

Choose a reason for hiding this comment

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

Here is an example of how to use inheritance in puppet

) inherits mysql::params {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You can't use inherits on a defined type I tried this on https://github.com/puppetlabs/puppetlabs-mysql/pull/1377/files as you can see but the pipeline failed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ohh you're right, please use include mysql::params.
Something like this https://puppet.com/docs/puppet/5.5/lang_defined_types.html#containment

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 did not test this, but do you suggest to reverse my changes and only include the mysql::params ? Is this not already being covered by the include 'mysql::client' as this class is also including the mysql::params?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @JvGinkel, I tested your changes and it's working! I will proceed to merge this PR.
Thanks for your contributions!

kind regards,
@adrianiurca

@@ -53,14 +53,20 @@
Enum['absent', 'present'] $ensure = 'present',
$import_timeout = 300,
$import_cat_cmd = 'cat',
$mysql_exec_path = $mysql::params::exec_path,
$mysql_exec_path = undef,
) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @JvGinkel, I tested your changes and it's working! I will proceed to merge this PR.
Thanks for your contributions!

kind regards,
@adrianiurca

@adrianiurca adrianiurca merged commit 0689348 into puppetlabs:main Apr 12, 2021
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.

None yet

3 participants