]> git.openstreetmap.org Git - chef.git/commitdiff
Fix new rubocop warnings
authorTom Hughes <tom@compton.nu>
Wed, 24 Apr 2019 20:12:04 +0000 (21:12 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 24 Apr 2019 20:12:04 +0000 (21:12 +0100)
cookbooks/letsencrypt/files/default/bin/check-certificate
cookbooks/planet/files/default/replication-bin/replicate-changesets

index f3599a36f17b7a1d6d590131b576b377d095521e..73bd8a658c1731a2f15b835ddb2f9ef4e4b1050b 100755 (executable)
@@ -17,8 +17,8 @@ begin
   ssl.sync_close = true
   ssl.hostname = domains.first
   ssl.connect
-rescue StandardError => error
-  puts "Error connecting to #{host}: #{error.message}"
+rescue StandardError => e
+  puts "Error connecting to #{host}: #{e.message}"
 end
 
 if ssl
@@ -30,7 +30,7 @@ if ssl
     puts "Certificate #{domains.first} on #{host} expires at #{certificate.not_after}"
   end
 
-  subject_alt_name = certificate.extensions.find { |e| e.oid == "subjectAltName" }
+  subject_alt_name = certificate.extensions.find { |ext| ext.oid == "subjectAltName" }
 
   if subject_alt_name.nil?
     puts "Certificate #{domains.first} on #{host} has no subjectAltName"
index 363d6040a4d7db9dd0ff9b80028d4e24567cfc7b..29131b2edd27c2394fb5d83f76157912d90a58ec 100755 (executable)
@@ -278,7 +278,7 @@ class Replicator
 
         fl.flock(File::LOCK_UN)
       rescue StandardError
-        STDERR.puts("Error! Couldn't update state.")
+        warn "Error! Couldn't update state."
         fl.flock(File::LOCK_UN)
         raise
       end
@@ -290,6 +290,6 @@ begin
   rep = Replicator.new(ARGV[0])
   rep.save!
 rescue StandardError => e
-  STDERR.puts "ERROR: #{e.message}"
+  warn "ERROR: #{e.message}"
   exit 1
 end