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

Remove legacy (old API) mysql_password function #1299

Conversation

alexjfisher
Copy link
Collaborator

There's been a properly namespaced modern mysql::password function for
some time. See #1044

When the modern API non-namespaced shim was removed in a68004c
the puppet/parser/functions version still existed so users who hadn't
migrated to mysql::password would have reverted to this legacy API version.

This commit finally removes the legacy version, but puts back the shim
for now (to not create a breaking change just yet).

Both namespaced and non-namespaced shim are tested.

There's been a properly namespaced modern `mysql::password` function for
some time.  See puppetlabs#1044

When the modern API non-namespaced shim was removed in a68004c
the `puppet/parser/functions` version still existed so users who hadn't
migrated to `mysql::password` would have reverted to this legacy API version.

This commit finally removes the legacy version, but puts back the shim
for now (to not create a breaking change just yet).

Both namespaced and non-namespaced shim are tested.
@alexjfisher alexjfisher requested a review from a team as a code owner April 28, 2020 15:20
@david22swan david22swan merged commit 39b7bde into puppetlabs:master Apr 30, 2020
@oniGino
Copy link

oniGino commented Sep 24, 2020

running module 10.7.0 getting function not found on mysql::password, with puppet 5.5.20

@sazzle2611
Copy link

running module 10.8.0 with puppet 5.5.22 and getting error Unknown function: 'mysql::password'

@Jimadine
Copy link

Jimadine commented Dec 8, 2021

@sazzle2611 @oniGino Either of you work out what was going on with puppet 5.5..2x and the mysql::password function? I am facing the same Error: Evaluation Error: Unknown function: 'mysql::password'. issue. (puppet 5.5.22 on ubuntu 18)

@sazzle2611
Copy link

@Jimadine sorry no I didn't, our issue was resolved in the end, probably after an upgrade but can't remember for sure now

@alexjfisher
Copy link
Collaborator Author

@Jimadine My guess is that you're calling the function from a module which doesn't list puppetlabs/mysql as a dependency in its metadata.json?

From https://github.com/puppetlabs/puppet-specifications/blob/master/language/func-api.md ...

Note: A module that wants to call a function in another module must either have that module listed as a dependency, or have no dependencies entry at all in its metadata.json. This requirement is enforced at runtime to help users keep metadata for modules up to date as users then simply need to install a module and its dependencies. If a module does not have the correct dependencies listed the runtime will simply not find the function.

This restriction was removed in Puppet 6.0.0. (It was almost removed in 5.5.x too, but the change reverted due to a regression.)

@alexjfisher alexjfisher deleted the remove_legacy_mysql_password_function branch December 9, 2021 09:54
@Jimadine
Copy link

Jimadine commented Dec 9, 2021

@alexjfisher Thank you! That was indeed the cause of the problem.

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.

6 participants