]> git.openstreetmap.org Git - chef.git/commitdiff
Merge pull request #232 from Tigerfell/master
authorGrant <git@firefishy.com>
Fri, 26 Apr 2019 21:42:51 +0000 (22:42 +0100)
committerGitHub <noreply@github.com>
Fri, 26 Apr 2019 21:42:51 +0000 (22:42 +0100)
Allow sysops to modify interwiki table

.rubocop.yml
Gemfile
Gemfile.lock
cookbooks/letsencrypt/files/default/bin/check-certificate
cookbooks/planet/files/default/replication-bin/replicate-changesets

index 5823b51329c5539eb6ff6790245e971c41829046..f5d3d4c19bf1ac03803fe9c3112f14a2e765dc87 100644 (file)
@@ -1,5 +1,7 @@
 inherit_from: .rubocop_todo.yml
 
+require: rubocop-performance
+
 AllCops:
   TargetRubyVersion: 2.3
 
diff --git a/Gemfile b/Gemfile
index b701698701ae715aba9cfc4226332e28f89741e3..078ade7b28208ecb54a275e5674974853b47f491 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -3,5 +3,6 @@ source "https://rubygems.org"
 gem "foodcritic"
 gem "kitchen-vagrant"
 gem "rubocop"
+gem "rubocop-performance"
 gem "serverspec"
 gem "test-kitchen"
index 8d5b39b381e25b34df07f7db7ca86d2ad8b31c69..9ca0bd89da1b14fffb051363b91c6ffb56cf29df 100644 (file)
@@ -2,7 +2,8 @@ GEM
   remote: https://rubygems.org/
   specs:
     ast (2.4.0)
-    backports (3.12.0)
+    backports (3.13.0)
+    bcrypt_pbkdf (1.0.1)
     builder (3.2.3)
     cucumber-core (3.2.1)
       backports (>= 3.8.0)
@@ -10,6 +11,7 @@ GEM
       gherkin (~> 5.0)
     cucumber-tag_expressions (1.1.1)
     diff-lcs (1.3)
+    ed25519 (1.2.4)
     erubis (2.7.0)
     ffi (1.10.0)
     ffi-yajl (2.3.1)
@@ -37,7 +39,7 @@ GEM
       little-plugger (~> 1.1)
       multi_json (~> 1.10)
     mini_portile2 (2.4.0)
-    mixlib-install (3.11.11)
+    mixlib-install (3.11.12)
       mixlib-shellout
       mixlib-versioning
       thor
@@ -50,11 +52,11 @@ GEM
     net-ssh-gateway (2.0.0)
       net-ssh (>= 4.0.0)
     net-telnet (0.1.1)
-    nokogiri (1.10.2)
+    nokogiri (1.10.3)
       mini_portile2 (~> 2.4.0)
     nori (2.6.0)
-    parallel (1.16.2)
-    parser (2.6.2.0)
+    parallel (1.17.0)
+    parser (2.6.2.1)
       ast (~> 2.4.0)
     polyglot (0.3.5)
     psych (3.1.0)
@@ -66,17 +68,17 @@ GEM
       rspec-mocks (~> 3.8.0)
     rspec-core (3.8.0)
       rspec-support (~> 3.8.0)
-    rspec-expectations (3.8.2)
+    rspec-expectations (3.8.3)
       diff-lcs (>= 1.2.0, < 2.0)
       rspec-support (~> 3.8.0)
-    rspec-its (1.2.0)
+    rspec-its (1.3.0)
       rspec-core (>= 3.0.0)
       rspec-expectations (>= 3.0.0)
     rspec-mocks (3.8.0)
       diff-lcs (>= 1.2.0, < 2.0)
       rspec-support (~> 3.8.0)
     rspec-support (3.8.0)
-    rubocop (0.66.0)
+    rubocop (0.67.2)
       jaro_winkler (~> 1.5.1)
       parallel (~> 1.10)
       parser (>= 2.5, != 2.5.1.1)
@@ -84,6 +86,8 @@ GEM
       rainbow (>= 2.2.2, < 4.0)
       ruby-progressbar (~> 1.7)
       unicode-display_width (>= 1.4.0, < 1.6)
+    rubocop-performance (1.1.0)
+      rubocop (>= 0.67.0)
     ruby-progressbar (1.10.0)
     rubyntlm (0.6.2)
     rubyzip (1.2.2)
@@ -99,7 +103,9 @@ GEM
       net-ssh (>= 2.7)
       net-telnet (= 0.1.1)
       sfl
-    test-kitchen (2.0.1)
+    test-kitchen (2.1.0)
+      bcrypt_pbkdf (~> 1.0)
+      ed25519 (~> 1.2)
       mixlib-install (~> 3.6)
       mixlib-shellout (>= 1.2, < 3.0)
       net-scp (>= 1.1, < 3.0)
@@ -138,6 +144,7 @@ DEPENDENCIES
   foodcritic
   kitchen-vagrant
   rubocop
+  rubocop-performance
   serverspec
   test-kitchen
 
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