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

Allow uppercase in variable names for Galera wsrep variables #501

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
bugfix:
- mysql_variables - Add uppercase character pattern to regex to allow GLOBAL
variables containing uppercase characters.
This recognises variable names used in Galera, e.g. wsrep_OSU_method,
which break the normal pattern of all lowercase characters.
Copy link
Collaborator

@Andersson007 Andersson007 Feb 2, 2023

Choose a reason for hiding this comment

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

Suggested change
bugfix:
- mysql_variables - Add uppercase character pattern to regex to allow GLOBAL
variables containing uppercase characters.
This recognises variable names used in Galera, e.g. wsrep_OSU_method,
which break the normal pattern of all lowercase characters.
bugfixes:
- mysql_variables - add uppercase character pattern to regex to allow GLOBAL
variables containing uppercase characters.
This recognizes variable names used in Galera, for example, ``wsrep_OSU_method``,
which breaks the normal pattern of all lowercase characters (https://github.com/ansible-collections/community.mysql/pull/501).

Copy link
Collaborator

@Andersson007 Andersson007 Feb 2, 2023

Choose a reason for hiding this comment

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

sorry i made a mistake in the key
bugfix -> bugfixes (this will fix the sanity errors)
Also fyi: I'll be on Fosdem and if nobody merges it before I'll merge this at the end of next week

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please make any changes you think are suitable. I only started working with Ansible last week so I'm really happy you were even considering accepting the change.

2 changes: 1 addition & 1 deletion plugins/modules/mysql_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def main():

if mysqlvar is None:
module.fail_json(msg="Cannot run without variable to operate with")
if match('^[0-9a-z_.]+$', mysqlvar) is None:
if match('^[0-9A-Za-z_.]+$', mysqlvar) is None:
module.fail_json(msg="invalid variable name \"%s\"" % mysqlvar)
if mysql_driver is None:
module.fail_json(msg=mysql_driver_fail_msg)
Expand Down