From f90398a31d045961017e9cd8b80ccabc3c29141f Mon Sep 17 00:00:00 2001 From: Benjamin MALYNOVYTCH Date: Mon, 6 May 2019 16:25:43 +0200 Subject: [PATCH] mysql_user: fix regression (#55292) --- .../mysql_user-fix-versions-compatibilities-regression.yml | 2 ++ lib/ansible/modules/database/mysql/mysql_user.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/mysql_user-fix-versions-compatibilities-regression.yml diff --git a/changelogs/fragments/mysql_user-fix-versions-compatibilities-regression.yml b/changelogs/fragments/mysql_user-fix-versions-compatibilities-regression.yml new file mode 100644 index 0000000000..1089f4ceb7 --- /dev/null +++ b/changelogs/fragments/mysql_user-fix-versions-compatibilities-regression.yml @@ -0,0 +1,2 @@ +bugfixes: +- "mysql_user: fix regression introduced when fixing MariaDB/MySQL multiple versions handling" diff --git a/lib/ansible/modules/database/mysql/mysql_user.py b/lib/ansible/modules/database/mysql/mysql_user.py index d233f8a132..dd68da27f2 100644 --- a/lib/ansible/modules/database/mysql/mysql_user.py +++ b/lib/ansible/modules/database/mysql/mysql_user.py @@ -479,7 +479,7 @@ def privileges_get(cursor, user, host): return x for grant in grants: - res = re.match("""GRANT (.+) ON (.+) TO (['`"]).*\\3@(['`"]).*\\4( IDENTIFIED BY PASSWORD (['`"]).+\5)? ?(.*)""", grant[0]) + res = re.match("""GRANT (.+) ON (.+) TO (['`"]).*\\3@(['`"]).*\\4( IDENTIFIED BY PASSWORD (['`"]).+\\6)? ?(.*)""", grant[0]) if res is None: raise InvalidPrivsError('unable to parse the MySQL grant string: %s' % grant[0]) privileges = res.group(1).split(", ")