Skip to content

[MODULES-3441] Discover mysql version using facts #852

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 15, 2016

Conversation

jtopper
Copy link
Contributor

@jtopper jtopper commented Jun 3, 2016

Per https://tickets.puppetlabs.com/browse/MODULES-3441, the mysql module has behaviour which varies by server version. The version is discovered by running mysqld -V. On hosts without a MySQL server package install, this fails, which means that contrary to the README, it's not actually possible to use this module to manage a remote db.

This PR moves the version string discovery into a new fact, mysqld_version which is used by the provider. This makes it possible to configure the db version with a custom fact when a remote db (eg AWS RDS) is being managed.

@@ -0,0 +1,5 @@
Facter.add("mysqld_version") do
setcode do
Facter::Util::Resolution.exec('mysqld -V')
Copy link

Choose a reason for hiding this comment

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

Does this one not need the .compact method chained on it, like it used to do on the provider?

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 think the .compact is superfluous. It'd remove nil elements from a list. In the provider, the call to .compact is run against an anonymous, single-item list, where it will have no effect.

Copy link

Choose a reason for hiding this comment

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

💯

@bmjen
Copy link
Contributor

bmjen commented Jun 8, 2016

Thanks @jtopper, this looks good and satisfies a need. Can you squash the commits?

@jtopper
Copy link
Contributor Author

jtopper commented Jun 8, 2016

I can squash the commits by all means, but the contributing doc requests that contributors "Make commits of logical units". Which is it? :)

@daenney
Copy link

daenney commented Jun 8, 2016

I would squash the docs into the previous commit, since using the fact and updating the documentation about the fact that this is the case should be one thing.

@bmjen
Copy link
Contributor

bmjen commented Jun 9, 2016

Yep. What @daenney said. We usually like to combine feature+test+docs into 1 logical commit. So if a reversion or cherry-pick needed to happen, it all comes out as one logical chunk.

Per https://tickets.puppetlabs.com/browse/MODULES-3441, the mysql
module has behaviour which varies by server version. The version is
discovered by running mysqld -V. On hosts without a MySQL server
package install, this fails, which means that contrary to the README,
it's not actually possible to use this module to manage a remote db.

This PR moves the version string discovery into a new fact,
mysqld_version which is used by the provider. This makes it possible
to configure the db version with a custom fact when a remote db
(eg AWS RDS) is being managed.
@jtopper jtopper force-pushed the use_fact_for_mysqld_version branch from 4c1d543 to ec5450e Compare June 15, 2016 08:49
@jtopper
Copy link
Contributor Author

jtopper commented Jun 15, 2016

Cool, no problem. I've just squashed everything.

@DavidS DavidS merged commit 86a51fd into puppetlabs:master Jun 15, 2016
@DavidS
Copy link
Contributor

DavidS commented Jun 15, 2016

Thanks for your contribution!

@daenney
Copy link

daenney commented Jun 15, 2016

Woohoo 😄.

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