From 7411ad42bdd1096476f6bfac05a724f6e1fdc19d Mon Sep 17 00:00:00 2001 From: Jorge-Rodriguez Date: Sat, 12 Sep 2020 15:24:13 +0300 Subject: [PATCH] Fix cursor parsing --- plugins/modules/mysql_user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/mysql_user.py b/plugins/modules/mysql_user.py index 2fb340a..3ddf1fa 100644 --- a/plugins/modules/mysql_user.py +++ b/plugins/modules/mysql_user.py @@ -429,7 +429,7 @@ def get_tls_requires(cursor, user, host): query = "SHOW GRANTS for '%s'@'%s'" % (user, host) cursor.execute(query) - require_list = list(filter(lambda x: "REQUIRE" in x, cursor.fetchall())) + require_list = [tuple[0] for tuple in filter(lambda x: "REQUIRE" in x[0], cursor.fetchall())] require_line = require_list[0] if require_list else "" pattern = r"(?<=\bREQUIRE\b)(.*?)(?=(?:\bPASSWORD\b|$))" requires_match = re.search(pattern, require_line)