mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-05 10:10:32 -07:00
Fix tls_requires data structure inconsistencies between modules
This commit is contained in:
parent
502bf58df1
commit
5460dec642
2 changed files with 6 additions and 4 deletions
|
@ -102,14 +102,15 @@ def get_tls_requires(cursor, user, host):
|
|||
if isinstance(res, dict):
|
||||
res = list(res.values())
|
||||
|
||||
if not res:
|
||||
# When user don't require SSL, res value is: ('', '', '', '')
|
||||
if not any(res):
|
||||
return None
|
||||
|
||||
if res[0] == 'ANY':
|
||||
return {'SSL': ''}
|
||||
return 'SSL'
|
||||
|
||||
if res[0] == 'X509':
|
||||
return {'X509': ''}
|
||||
return 'X509'
|
||||
|
||||
if res[1]:
|
||||
tls_requires['CIPHER'] = res[1]
|
||||
|
|
|
@ -301,6 +301,7 @@ from ansible_collections.community.mysql.plugins.module_utils.user import (
|
|||
get_resource_limits,
|
||||
get_existing_authentication,
|
||||
get_tls_requires,
|
||||
sanitize_requires,
|
||||
)
|
||||
from ansible.module_utils.six import iteritems
|
||||
from ansible.module_utils._text import to_native
|
||||
|
@ -612,7 +613,7 @@ class MySQL_Info(object):
|
|||
'host': host,
|
||||
'priv': '/'.join(priv_string),
|
||||
'resource_limits': copy_ressource_limits,
|
||||
'tls_requires': tls_requires,
|
||||
'tls_requires': sanitize_requires(tls_requires),
|
||||
}
|
||||
|
||||
# Prevent returning a resource limit if empty
|
||||
|
|
Loading…
Add table
Reference in a new issue