From 4c8a9859977e82e23da4b84f17db05cf295b5d68 Mon Sep 17 00:00:00 2001 From: "R. Sicart" Date: Wed, 31 Aug 2022 13:38:23 +0200 Subject: [PATCH] Fix: Only revoke grant option if it exists and absence is requested --- plugins/module_utils/user.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/module_utils/user.py b/plugins/module_utils/user.py index 3c4863a..0b1b306 100644 --- a/plugins/module_utils/user.py +++ b/plugins/module_utils/user.py @@ -367,8 +367,7 @@ def user_mod(cursor, user, host, host_all, password, encrypted, # # For more details # https://github.com/ansible-collections/community.mysql/issues/77#issuecomment-1209693807 - if 'GRANT' in grant_privs: - grant_option = 'GRANT' in revoke_privs and 'GRANT' not in grant_privs + grant_option = 'GRANT' in revoke_privs and 'GRANT' not in grant_privs if grant_privs == ['GRANT']: # USAGE grants no privileges, it is only needed because 'WITH GRANT OPTION' cannot stand alone