]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/mysql/libraries/mysql.rb
Fix rubocop warnings
[chef.git] / cookbooks / mysql / libraries / mysql.rb
index dc692a780f03c37a7a6c47f3a1422de50d39fdc0..7c45022fd4fc2b36980d0aa4753893d8240158e5 100644 (file)
@@ -55,7 +55,7 @@ class Chef
 
     def query(sql, options = {})
       # Run the query
-      result = execute(options.merge(:command => sql, :xml => :true))
+      result = execute(options.merge(:command => sql, :xml => true))
 
       # Parse the output
       document = REXML::Document.new(result.stdout)
@@ -119,7 +119,7 @@ class Chef
     def canonicalise_user(user)
       local, host = user.split("@")
 
-      host = "%" unless host
+      host ||= "%"
 
       local = "'#{local}'" unless local =~ /^'.*'$/
       host = "'#{host}'" unless host =~ /^'.*'$/