mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-21 18:01:28 -07:00
Refactor to keep plugin_auth_string
This commit is contained in:
parent
9b2624c942
commit
04f24c57f3
2 changed files with 13 additions and 3 deletions
|
@ -118,11 +118,21 @@ def get_existing_authentication(cursor, user, host):
|
|||
if isinstance(rows, dict):
|
||||
rows = list(rows.values())
|
||||
|
||||
# 'plugin_auth_string' contains the hash string. Must be removed in c.mysql 4.0
|
||||
# See https://github.com/ansible-collections/community.mysql/pull/629
|
||||
if isinstance(rows[0], tuple):
|
||||
return {'plugin': rows[0][0], 'plugin_hash_string': rows[0][1]}
|
||||
return {'plugin': rows[0][0],
|
||||
'plugin_auth_string': rows[0][1],
|
||||
'plugin_hash_string': rows[0][1]
|
||||
}
|
||||
|
||||
# 'plugin_auth_string' contains the hash string. Must be removed in c.mysql 4.0
|
||||
# See https://github.com/ansible-collections/community.mysql/pull/629
|
||||
if isinstance(rows[0], dict):
|
||||
return {'plugin': rows[0].get('plugin'), 'plugin_hash_string': rows[0].get('auth')}
|
||||
return {'plugin': rows[0].get('plugin'),
|
||||
'plugin_auth_string': rows[0].get('auth'),
|
||||
'plugin_hash_string': rows[0].get('auth')
|
||||
}
|
||||
return None
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue