Skip to content

Commit

Permalink
Fix problem with GRANT not recognizing backslash
Browse files Browse the repository at this point in the history
If database grant has backslash in database name (for example: example\_dev), then puppet will try to apply same resource every run because MySQL reports that table name with double backslash (for example: example\\_dev). By global replace of double backslash with single one, this issue is fixed.
  • Loading branch information
jsosic committed Jul 13, 2014
1 parent c6acbf5 commit 3566723
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/puppet/provider/mysql_grant/mysql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def self.instances
end
# Same here, but to remove OPTION leaving just GRANT.
options = ['GRANT'] if rest.match(/WITH\sGRANT\sOPTION/)
# fix double backslash that MySQL prints, so resources match
table.gsub!("\\\\", "\\")
# We need to return an array of instances so capture these
instances << new(
:name => "#{user}@#{host}/#{table}",
Expand Down

0 comments on commit 3566723

Please sign in to comment.