Fix problem with GRANT not recognizing backslash
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.
This commit is contained in:
parent
c6acbf5a53
commit
356672342e
1 changed files with 2 additions and 0 deletions
|
@ -36,6 +36,8 @@ Puppet::Type.type(:mysql_grant).provide(:mysql, :parent => Puppet::Provider::Mys
|
|||
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}",
|
||||
|
|
Loading…
Reference in a new issue