X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/fb1f1d56e8d8a6a86b79c71546e6c114fec2640c..2714460f8457266fec0f5f9d72d900b384d5b724:/cookbooks/mysql/libraries/mysql.rb diff --git a/cookbooks/mysql/libraries/mysql.rb b/cookbooks/mysql/libraries/mysql.rb index 769df807e..61d600f1d 100644 --- a/cookbooks/mysql/libraries/mysql.rb +++ b/cookbooks/mysql/libraries/mysql.rb @@ -11,14 +11,14 @@ class Chef :show_db, :super, :create_tmp_table, :lock_tables, :execute, :repl_slave, :repl_client, :create_view, :show_view, :create_routine, :alter_routine, :create_user, :event, :trigger, :create_tablespace - ] + ].freeze DATABASE_PRIVILEGES = [ :select, :insert, :update, :delete, :create, :drop, :grant, :references, :index, :alter, :create_tmp_table, :lock_tables, :create_view, :show_view, :create_routine, :alter_routine, :execute, :event, :trigger - ] + ].freeze def execute(options) # Create argument array @@ -104,7 +104,9 @@ class Chef end query("SELECT * FROM db").each do |record| - next unless database = @databases[record[:db]] + database = @databases[record[:db]] + + next unless database user = "'#{record[:user]}'@'#{record[:host]}'"