Skip to content

Commit 23672ca

Browse files
committed
Merge pull request #779 from jmcclell/patch-1
Fixes edge-case with dropping pre-existing users with grants
2 parents 0b3e310 + 1bad8ae commit 23672ca

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/puppet/provider/mysql_grant/mysql.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ def revoke(user, table, revoke_privileges = ['ALL'])
114114
end
115115

116116
def destroy
117-
revoke(@property_hash[:user], @property_hash[:table])
117+
# if the user was dropped, it'll have been removed from the user hash
118+
# as the grants are alraedy removed by the DROP statement
119+
if self.class.users.include? @property_hash[:user]
120+
revoke(@property_hash[:user], @property_hash[:table])
121+
end
118122
@property_hash.clear
119123

120124
exists? ? (return false) : (return true)

0 commit comments

Comments
 (0)