mysql_grant bugfix: remove duplicate privileges and GRANT privilege, otherwise the resource gets changed every puppet run

This commit is contained in:
Reinhard Vicinus 2013-12-11 13:17:52 +01:00
parent 9de42ac43e
commit 07c3b76eb9

View file

@ -17,7 +17,7 @@ Puppet::Type.newtype(:mysql_grant) do
# Sort the privileges array in order to ensure the comparision in the provider
# self.instances method match. Otherwise this causes it to keep resetting the
# privileges.
self[:privileges] = Array(self[:privileges]).sort!
self[:privileges] = Array(self[:privileges]).map(&:upcase).uniq.reject{|k| k == 'GRANT' or k == 'GRANT OPTION'}.sort!
end
validate do