Merge pull request #569 from fnerdwq/mysql_grant_revokation

(MODULES-1330) Change order of revokation.
This commit is contained in:
Igor Galić 2014-09-16 15:02:13 +02:00
commit 443ff061ea

View file

@ -89,13 +89,15 @@ Puppet::Type.type(:mysql_grant).provide(:mysql, :parent => Puppet::Provider::Mys
user_string = self.class.cmd_user(user) user_string = self.class.cmd_user(user)
table_string = self.class.cmd_table(table) table_string = self.class.cmd_table(table)
query = "REVOKE ALL ON #{table_string} FROM #{user_string}"
mysql([defaults_file, '-e', query].compact)
# revoke grant option needs to be a extra query, because # revoke grant option needs to be a extra query, because
# "REVOKE ALL PRIVILEGES, GRANT OPTION [..]" is only valid mysql syntax # "REVOKE ALL PRIVILEGES, GRANT OPTION [..]" is only valid mysql syntax
# if no ON clause is used. # if no ON clause is used.
# It hast to be executed before "REVOKE ALL [..]" since a GRANT has to
# exist to be executed successfully
query = "REVOKE GRANT OPTION ON #{table_string} FROM #{user_string}" query = "REVOKE GRANT OPTION ON #{table_string} FROM #{user_string}"
mysql([defaults_file, '-e', query].compact) mysql([defaults_file, '-e', query].compact)
query = "REVOKE ALL ON #{table_string} FROM #{user_string}"
mysql([defaults_file, '-e', query].compact)
end end
def destroy def destroy