mysql_grant bugfix: on table *.* SHOW GRANT can return 'WITH MAX_QUERIES_PER_HOUR' which breaks the captures on the match

This commit is contained in:
Reinhard Vicinus 2013-12-11 13:15:21 +01:00
parent d69a5f15b3
commit f5a78f1c5f

View file

@ -22,7 +22,7 @@ Puppet::Type.type(:mysql_grant).provide(:mysql, :parent => Puppet::Provider::Mys
priv == 'ALL PRIVILEGES' ? 'ALL' : priv.lstrip.rstrip priv == 'ALL PRIVILEGES' ? 'ALL' : priv.lstrip.rstrip
end end
# Same here, but to remove OPTION leaving just GRANT. # Same here, but to remove OPTION leaving just GRANT.
options = rest.match(/WITH\s(.*)\sOPTION$/).captures if rest.include?('WITH') options = ['GRANT'] if rest.match(/WITH\sGRANT\sOPTION/)
# We need to return an array of instances so capture these # We need to return an array of instances so capture these
instances << new( instances << new(
:name => "#{user}@#{host}/#{table}", :name => "#{user}@#{host}/#{table}",