Skip to content

Commit 173fb41

Browse files
committed
Improve matching of MySQL user hosts.
1 parent ca56d70 commit 173fb41

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pyinfra/facts/mysql.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,9 @@ def process(output):
157157
return users
158158

159159

160-
MYSQL_GRANT_REGEX = re.compile(
161-
r"^GRANT ([A-Z,\s]+) ON (\*|`[a-z_\\]+`\.\*|'[a-z_]+') TO `[a-z_\-]+`@`[a-z_\.\-]+`(.*)",
160+
MYSQL_GRANT_REGEX = (
161+
r"^GRANT ([A-Z,\s]+) ON (\*|`[a-z_\\]+`\.\*|'[a-z_]+') "
162+
r'TO `[A-Z0-9a-z_\-]+`@`[A-Z0-9a-z_\.\-]+`(.*)'
162163
)
163164

164165

0 commit comments

Comments
 (0)