Skip to content

Commit 8540e26

Browse files
committed
Merge pull request puppetlabs#587 from maxenced/fix-mysql-grant-parsing
The old regex requires something after the 'host' part. Fix this.
2 parents d45c1e4 + 46065c4 commit 8540e26

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/puppet/provider/mysql_grant/mysql.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def self.instances
2727
# Match the munges we do in the type.
2828
munged_grant = grant.delete("'").delete("`")
2929
# Matching: GRANT (SELECT, UPDATE) PRIVILEGES ON (*.*) TO ('root')@('127.0.0.1') (WITH GRANT OPTION)
30-
if match = munged_grant.match(/^GRANT\s(.+)\sON\s(.+)\sTO\s(.*)@(.*?)(\s.*)$/)
30+
if match = munged_grant.match(/^GRANT\s(.+)\sON\s(.+)\sTO\s(.*)@(.*?)(\s.*)?$/)
3131
privileges, table, user, host, rest = match.captures
3232
# split on ',' if it is not a non-'('-containing string followed by a
3333
# closing parenthesis ')'-char - e.g. only split comma separated elements not in

0 commit comments

Comments
 (0)