mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-21 05:21:46 -07:00
revert else removing
This commit is contained in:
parent
a4c57a66eb
commit
856753215f
1 changed files with 4 additions and 0 deletions
|
@ -190,6 +190,8 @@ def user_add(cursor, user, host, host_all, password, encrypted,
|
||||||
elif salt:
|
elif salt:
|
||||||
if plugin in ['caching_sha2_password', 'sha256_password']:
|
if plugin in ['caching_sha2_password', 'sha256_password']:
|
||||||
generated_hash_string = mysql_sha256_password_hash_hex(password=plugin_auth_string, salt=salt)
|
generated_hash_string = mysql_sha256_password_hash_hex(password=plugin_auth_string, salt=salt)
|
||||||
|
else:
|
||||||
|
module.fail_json(msg="salt not handled for %s authentication plugin" % plugin)
|
||||||
query_with_args = ("CREATE USER %s@%s IDENTIFIED WITH %s AS 0x" + generated_hash_string), (user, host, plugin)
|
query_with_args = ("CREATE USER %s@%s IDENTIFIED WITH %s AS 0x" + generated_hash_string), (user, host, plugin)
|
||||||
else:
|
else:
|
||||||
query_with_args = "CREATE USER %s@%s IDENTIFIED WITH %s BY %s", (user, host, plugin, plugin_auth_string)
|
query_with_args = "CREATE USER %s@%s IDENTIFIED WITH %s BY %s", (user, host, plugin, plugin_auth_string)
|
||||||
|
@ -373,6 +375,8 @@ def user_mod(cursor, user, host, host_all, password, encrypted,
|
||||||
elif salt:
|
elif salt:
|
||||||
if plugin in ['caching_sha2_password', 'sha256_password']:
|
if plugin in ['caching_sha2_password', 'sha256_password']:
|
||||||
generated_hash_string = mysql_sha256_password_hash_hex(password=plugin_auth_string, salt=salt)
|
generated_hash_string = mysql_sha256_password_hash_hex(password=plugin_auth_string, salt=salt)
|
||||||
|
else:
|
||||||
|
module.fail_json(msg="salt not handled for %s authentication plugin" % plugin)
|
||||||
query_with_args = ("ALTER USER %s@%s IDENTIFIED WITH %s AS 0x" + generated_hash_string), (user, host, plugin)
|
query_with_args = ("ALTER USER %s@%s IDENTIFIED WITH %s AS 0x" + generated_hash_string), (user, host, plugin)
|
||||||
else:
|
else:
|
||||||
query_with_args = "ALTER USER %s@%s IDENTIFIED WITH %s BY %s", (user, host, plugin, plugin_auth_string)
|
query_with_args = "ALTER USER %s@%s IDENTIFIED WITH %s BY %s", (user, host, plugin, plugin_auth_string)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue