From 8e782653644f985da15eb49e464ee44ecbdf2852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=20Sanju=C3=A1n?= Date: Wed, 28 Aug 2024 17:15:12 +0200 Subject: [PATCH] refactor --- plugins/module_utils/user.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/module_utils/user.py b/plugins/module_utils/user.py index 4135769..7d7d304 100644 --- a/plugins/module_utils/user.py +++ b/plugins/module_utils/user.py @@ -396,7 +396,7 @@ def user_mod(cursor, user, host, host_all, password, encrypted, query_with_args = None if plugin_hash_string: query_with_args = "ALTER USER %s@%s IDENTIFIED WITH %s AS %s", (user, host, plugin, plugin_hash_string) - elif plugin_auth_string and not module.check_mode: + elif plugin_auth_string: # Mysql and MariaDB differ in naming pam plugin and syntax to set it if plugin in ('pam', 'ed25519'): query_with_args = "ALTER USER %s@%s IDENTIFIED WITH %s USING %s", (user, host, plugin, plugin_auth_string) @@ -408,7 +408,7 @@ def user_mod(cursor, user, host, host_all, password, encrypted, query_with_args = ("ALTER USER %s@%s IDENTIFIED WITH %s AS 0x" + generated_hash_string), (user, host, plugin) else: query_with_args = "ALTER USER %s@%s IDENTIFIED WITH %s BY %s", (user, host, plugin, plugin_auth_string) - elif not module.check_mode: + else: query_with_args = "ALTER USER %s@%s IDENTIFIED WITH %s", (user, host, plugin) if not module.check_mode: