]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/mysql/libraries/mysql.rb
Rubocop cleanups
[chef.git] / cookbooks / mysql / libraries / mysql.rb
index 2b2bca67d35767b71349058e547cf9799b1bf44a..769df807e0eda0c37c6c71c60ad90cbd595df34b 100644 (file)
@@ -104,12 +104,12 @@ class Chef
       end
 
       query("SELECT * FROM db").each do |record|
-        if database = @databases[record[:db]]
-          user = "'#{record[:user]}'@'#{record[:host]}'"
+        next unless database = @databases[record[:db]]
 
-          database[:permissions][user] = DATABASE_PRIVILEGES.each_with_object([]) do |privilege, privileges|
-            privileges << privilege if record["#{privilege}_priv".to_sym] == "Y"
-          end
+        user = "'#{record[:user]}'@'#{record[:host]}'"
+
+        database[:permissions][user] = DATABASE_PRIVILEGES.each_with_object([]) do |privilege, privileges|
+          privileges << privilege if record["#{privilege}_priv".to_sym] == "Y"
         end
       end