mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-08 23:24:23 -07:00
Fix according to PR review
This commit is contained in:
parent
b17b394fe7
commit
b01a740b76
1 changed files with 15 additions and 12 deletions
|
@ -968,8 +968,8 @@ def convert_priv_dict_to_str(priv):
|
||||||
|
|
||||||
|
|
||||||
def handle_requiressl_in_priv_string(module, priv, tls_requires):
|
def handle_requiressl_in_priv_string(module, priv, tls_requires):
|
||||||
if "REQUIRESSL" in priv:
|
module.deprecate('The "REQUIRESSL" privilege is deprecated, use the "tls_requires" option instead.',
|
||||||
module.deprecate('The "REQUIRESSL" privilege is deprecated, use the "tls_requires" option instead.', version='3.0.0', collection_name='community.mysql')
|
version='3.0.0', collection_name='community.mysql')
|
||||||
priv_groups = re.search(r"(.*?)(\*\.\*:)([^/]*)(.*)", priv)
|
priv_groups = re.search(r"(.*?)(\*\.\*:)([^/]*)(.*)", priv)
|
||||||
if priv_groups.group(3) == "REQUIRESSL":
|
if priv_groups.group(3) == "REQUIRESSL":
|
||||||
priv = priv_groups.group(1) + priv_groups.group(4) or None
|
priv = priv_groups.group(1) + priv_groups.group(4) or None
|
||||||
|
@ -1175,6 +1175,9 @@ def main():
|
||||||
if priv and isinstance(priv, dict):
|
if priv and isinstance(priv, dict):
|
||||||
priv = convert_priv_dict_to_str(priv)
|
priv = convert_priv_dict_to_str(priv)
|
||||||
|
|
||||||
|
if "REQUIRESSL" in priv:
|
||||||
|
priv, tls_requires = handle_requiressl_in_priv_string(module, priv, tls_requires)
|
||||||
|
|
||||||
if mysql_driver is None:
|
if mysql_driver is None:
|
||||||
module.fail_json(msg=mysql_driver_fail_msg)
|
module.fail_json(msg=mysql_driver_fail_msg)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue