From 07c3b76eb9cbca651d693db050eaa647a17537a4 Mon Sep 17 00:00:00 2001 From: Reinhard Vicinus Date: Wed, 11 Dec 2013 13:17:52 +0100 Subject: [PATCH] mysql_grant bugfix: remove duplicate privileges and GRANT privilege, otherwise the resource gets changed every puppet run --- lib/puppet/type/mysql_grant.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/type/mysql_grant.rb b/lib/puppet/type/mysql_grant.rb index 48a121a..be8dfbc 100644 --- a/lib/puppet/type/mysql_grant.rb +++ b/lib/puppet/type/mysql_grant.rb @@ -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