From 90a349e0bc558441e65156eabb585c578d93fbfd Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 11 Jul 2017 20:33:05 +0100 Subject: [PATCH] Fix new rubocop warnings --- .rubocop.yml | 16 ++++++++++++-- cookbooks/apache/recipes/default.rb | 2 +- cookbooks/dev/recipes/default.rb | 2 +- cookbooks/hardware/attributes/default.rb | 10 ++++----- cookbooks/hardware/recipes/default.rb | 8 +++---- cookbooks/imagery/recipes/gb_os_sv.rb | 1 + cookbooks/imagery/resources/site.rb | 3 ++- cookbooks/kibana/recipes/default.rb | 1 + cookbooks/memcached/recipes/default.rb | 2 +- .../munin/files/default/plugins/api_calls_ | 2 +- .../munin/files/default/plugins/api_waits_ | 2 +- .../files/default/plugins/passenger_memory | 12 +++++----- .../files/default/plugins/passenger_processes | 22 +++++++++---------- .../files/default/plugins/passenger_queues | 12 +++++----- .../files/default/plugins/passenger_requests | 20 ++++++++--------- cookbooks/mysql/recipes/default.rb | 8 +++---- cookbooks/networking/recipes/default.rb | 2 +- cookbooks/nominatim/recipes/default.rb | 2 +- cookbooks/ntp/metadata.rb | 2 +- cookbooks/ntp/recipes/default.rb | 2 +- cookbooks/piwik/attributes/default.rb | 4 ++-- .../replication-bin/replicate-changesets | 5 ++--- cookbooks/planet/recipes/dump.rb | 2 +- cookbooks/postgresql/providers/munin.rb | 4 ++-- cookbooks/squid/recipes/default.rb | 2 +- cookbooks/ssl/recipes/default.rb | 2 +- cookbooks/systemd/resources/service.rb | 10 ++++----- cookbooks/taginfo/recipes/default.rb | 4 ++-- cookbooks/tile/recipes/default.rb | 4 ++-- cookbooks/web/recipes/cgimap.rb | 2 +- cookbooks/web/recipes/gpx.rb | 2 +- cookbooks/web/recipes/rails.rb | 2 +- hooks/pre-commit | 2 +- roles/bytemark.rb | 2 +- roles/dulcy.rb | 2 +- roles/grisu.rb | 2 +- roles/ic.rb | 2 +- roles/katla.rb | 2 +- roles/ladon.rb | 2 +- roles/paulla.rb | 1 + roles/pummelzacken.rb | 2 +- roles/spike-04.rb | 2 +- roles/spike-05.rb | 2 +- roles/teleservice.rb | 1 + roles/thorn-04.rb | 2 +- roles/thorn-05.rb | 2 +- roles/tyan-s7010.rb | 2 +- roles/web.rb | 2 +- 48 files changed, 110 insertions(+), 94 deletions(-) mode change 100644 => 100755 cookbooks/planet/files/default/replication-bin/replicate-changesets diff --git a/.rubocop.yml b/.rubocop.yml index 23c3f82fc..07985407d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,12 +1,18 @@ inherit_from: .rubocop_todo.yml -Style/AlignParameters: +AllCops: + TargetRubyVersion: 2.3 + +Layout/AlignParameters: Exclude: - '**/metadata.rb' -Style/ExtraSpacing: +Layout/ExtraSpacing: AllowForAlignment: true +Layout/IndentHeredoc: + EnforcedStyle: squiggly + Style/FileName: Exclude: - 'cookbooks/trac/files/default/trac-authenticate' @@ -15,8 +21,14 @@ Style/FileName: - 'hooks/*' - 'roles/*.rb' +Style/FrozenStringLiteralComment: + EnforcedStyle: never + Style/HashSyntax: EnforcedStyle: hash_rockets Style/StringLiterals: EnforcedStyle: double_quotes + +Style/SymbolArray: + EnforcedStyle: brackets diff --git a/cookbooks/apache/recipes/default.rb b/cookbooks/apache/recipes/default.rb index 72af9140b..9b6c6ef54 100644 --- a/cookbooks/apache/recipes/default.rb +++ b/cookbooks/apache/recipes/default.rb @@ -22,7 +22,7 @@ include_recipe "ssl" package "apache2" package "libwww-perl" -%w(event itk prefork worker).each do |mpm| +%w[event itk prefork worker].each do |mpm| if mpm == node[:apache][:mpm] apache_module "mpm_#{mpm}" do action [:enable] diff --git a/cookbooks/dev/recipes/default.rb b/cookbooks/dev/recipes/default.rb index 59fd78603..80b80586b 100644 --- a/cookbooks/dev/recipes/default.rb +++ b/cookbooks/dev/recipes/default.rb @@ -113,7 +113,7 @@ search(:accounts, "*:*").each do |account| name = account["id"] details = node[:accounts][:users][name] || {} - next unless %w(user administrator).include?(details[:status]) + next unless %w[user administrator].include?(details[:status]) user_home = details[:home] || account["home"] || "#{node[:accounts][:home]}/#{name}" diff --git a/cookbooks/hardware/attributes/default.rb b/cookbooks/hardware/attributes/default.rb index ce7aae863..393dd0317 100644 --- a/cookbooks/hardware/attributes/default.rb +++ b/cookbooks/hardware/attributes/default.rb @@ -1,10 +1,10 @@ default[:hardware][:modules] = if node[:lsb][:release].to_f >= 16.04 - %w(lp) + %w[lp] else - %w(loop lp rtc) + %w[loop lp rtc] end -default[:hardware][:grub][:cmdline] = %w(nomodeset) +default[:hardware][:grub][:cmdline] = %w[nomodeset] default[:hardware][:sensors] = {} if node[:dmi] && node[:dmi][:system] @@ -19,7 +19,7 @@ if node[:dmi] && node[:dmi][:system] end end -if Chef::Util.compare_versions(node[:kernel][:release], [3, 3]) < 0 +if Chef::Util.compare_versions(node[:kernel][:release], [3, 3]).negative? default[:hardware][:modules] |= ["microcode"] if node[:cpu][:"0"][:vendor_id] == "GenuineIntel" @@ -28,7 +28,7 @@ if Chef::Util.compare_versions(node[:kernel][:release], [3, 3]) < 0 end if node[:kernel] && node[:kernel][:modules] - raidmods = node[:kernel][:modules].keys & %w(cciss hpsa mptsas mpt2sas mpt3sas megaraid_mm megaraid_sas aacraid) + raidmods = node[:kernel][:modules].keys & %w[cciss hpsa mptsas mpt2sas mpt3sas megaraid_mm megaraid_sas aacraid] default[:apt][:sources] |= ["hwraid"] unless raidmods.empty? end diff --git a/cookbooks/hardware/recipes/default.rb b/cookbooks/hardware/recipes/default.rb index 012082789..1d5be55cc 100644 --- a/cookbooks/hardware/recipes/default.rb +++ b/cookbooks/hardware/recipes/default.rb @@ -86,7 +86,7 @@ end # Remove legacy HP G4 support which breaks modern hp-health 10.4 if manufacturer == "HP" - %w(/opt/hp/hp-health/bin/hpasmd /usr/lib/libhpasmintrfc.so.3.0 %/usr/lib/libhpasmintrfc.so.3 /usr/lib/libhpasmintrfc.so).each do |filename| + %w[/opt/hp/hp-health/bin/hpasmd /usr/lib/libhpasmintrfc.so.3.0 %/usr/lib/libhpasmintrfc.so.3 /usr/lib/libhpasmintrfc.so].each do |filename| file filename do action :delete end @@ -246,7 +246,7 @@ node[:block_device].each do |name, attributes| end end -%w(hpssacli lsiutil sas2ircu megactl megacli arcconf).each do |tools_package| +%w[hpssacli lsiutil sas2ircu megactl megacli arcconf].each do |tools_package| if tools_packages.include?(tools_package) package tools_package else @@ -384,7 +384,7 @@ smartd_service = if node[:lsb][:release].to_f >= 16.04 disks = disks.compact -if disks.count > 0 +if disks.count.positive? package "smartmontools" template "/usr/local/bin/smartd-mailer" do @@ -434,7 +434,7 @@ else end end -if disks.count > 0 +if disks.count.positive? munin_plugin "hddtemp_smartctl" do conf "munin.hddtemp.erb" conf_variables :disks => disks diff --git a/cookbooks/imagery/recipes/gb_os_sv.rb b/cookbooks/imagery/recipes/gb_os_sv.rb index 6dd2e9861..4dcf0bd0b 100644 --- a/cookbooks/imagery/recipes/gb_os_sv.rb +++ b/cookbooks/imagery/recipes/gb_os_sv.rb @@ -1,4 +1,5 @@ # coding: utf-8 + # # Cookbook Name:: imagery # Recipe:: gb_os_sv diff --git a/cookbooks/imagery/resources/site.rb b/cookbooks/imagery/resources/site.rb index 137153a72..d6e2071cc 100644 --- a/cookbooks/imagery/resources/site.rb +++ b/cookbooks/imagery/resources/site.rb @@ -89,9 +89,10 @@ action :create do end base_domains = [name] + Array(aliases) + tile_domains = base_domains.flat_map { |d| [d, "a.#{d}", "b.#{d}", "c.#{d}"] } ssl_certificate new_resource.name do - domains base_domains.flat_map { |d| [d, "a.#{d}", "b.#{d}", "c.#{d}"] } + domains tile_domains end resolvers = node[:networking][:nameservers].map do |resolver| diff --git a/cookbooks/kibana/recipes/default.rb b/cookbooks/kibana/recipes/default.rb index adc39270d..9f17df934 100644 --- a/cookbooks/kibana/recipes/default.rb +++ b/cookbooks/kibana/recipes/default.rb @@ -1,4 +1,5 @@ # coding: utf-8 + # # Cookbook Name:: kibana # Recipe:: default diff --git a/cookbooks/memcached/recipes/default.rb b/cookbooks/memcached/recipes/default.rb index e96af7e35..7186626c0 100644 --- a/cookbooks/memcached/recipes/default.rb +++ b/cookbooks/memcached/recipes/default.rb @@ -36,7 +36,7 @@ munin_plugin_conf "memcached_multi" do template "munin.erb" end -%w(bytes commands conns evictions items memory).each do |stat| +%w[bytes commands conns evictions items memory].each do |stat| munin_plugin "memcached_multi_#{stat}" do target "memcached_multi_" end diff --git a/cookbooks/munin/files/default/plugins/api_calls_ b/cookbooks/munin/files/default/plugins/api_calls_ index 17bba1625..79c306635 100755 --- a/cookbooks/munin/files/default/plugins/api_calls_ +++ b/cookbooks/munin/files/default/plugins/api_calls_ @@ -12,7 +12,7 @@ def uris_from_status(server) rows = (tables[1] / "tr")[1..-1] data = rows.collect { |r| (r / "td").collect(&:inner_html) } # filter where the PID is numeric, status is 'W' and host matches the server - matching_data = data.select { |r| r[1].to_i > 0 && r[3].match(/W/) && r[11].match(server) } + matching_data = data.select { |r| r[1].to_i.positive? && r[3].match(/W/) && r[11].match(server) } # return only the URI part matching_data.collect { |r| r[12] } end diff --git a/cookbooks/munin/files/default/plugins/api_waits_ b/cookbooks/munin/files/default/plugins/api_waits_ index 6be9fc6f5..f5bbd1104 100755 --- a/cookbooks/munin/files/default/plugins/api_waits_ +++ b/cookbooks/munin/files/default/plugins/api_waits_ @@ -12,7 +12,7 @@ def uri_and_times_from_status(server) rows = (tables[1] / "tr")[1..-1] data = rows.collect { |r| (r / "td").collect(&:inner_html) } # filter where the PID is numeric, status is 'W' and host matches the server - matching_data = data.select { |r| r[1].to_i > 0 && r[3].match(/W/) && r[11].match(server) } + matching_data = data.select { |r| r[1].to_i.positive? && r[3].match(/W/) && r[11].match(server) } # return URI and number of seconds processing for each request matching_data.collect { |r| [r[12], r[5].to_i] } end diff --git a/cookbooks/munin/files/default/plugins/passenger_memory b/cookbooks/munin/files/default/plugins/passenger_memory index 1aa9a7764..7017c63e0 100755 --- a/cookbooks/munin/files/default/plugins/passenger_memory +++ b/cookbooks/munin/files/default/plugins/passenger_memory @@ -6,13 +6,13 @@ require "English" def output_config - puts <<-END -graph_args --base 1024 -l 0 --vertical-label bytes --upper-limit 4056231936 -graph_category passenger -graph_title Passenger memory + puts <<~END + graph_args --base 1024 -l 0 --vertical-label bytes --upper-limit 4056231936 + graph_category passenger + graph_title Passenger memory -memory.label memory -END + memory.label memory + END exit 0 end diff --git a/cookbooks/munin/files/default/plugins/passenger_processes b/cookbooks/munin/files/default/plugins/passenger_processes index 39842a04f..b8a06cf3a 100755 --- a/cookbooks/munin/files/default/plugins/passenger_processes +++ b/cookbooks/munin/files/default/plugins/passenger_processes @@ -3,18 +3,18 @@ require "English" def output_config - puts <<-END -graph_category passenger -graph_title Passenger processes -graph_order active inactive -graph_vlabel processes -graph_total total + puts <<~END + graph_category passenger + graph_title Passenger processes + graph_order active inactive + graph_vlabel processes + graph_total total -active.label busy servers -active.draw AREA -inactive.label idle servers -inactive.draw STACK -END + active.label busy servers + active.draw AREA + inactive.label idle servers + inactive.draw STACK + END exit 0 end diff --git a/cookbooks/munin/files/default/plugins/passenger_queues b/cookbooks/munin/files/default/plugins/passenger_queues index 60be63389..8d4159b46 100755 --- a/cookbooks/munin/files/default/plugins/passenger_queues +++ b/cookbooks/munin/files/default/plugins/passenger_queues @@ -3,13 +3,13 @@ require "English" def output_config - puts <<-END -graph_category passenger -graph_title Passenger queues -graph_vlabel count + puts <<~END + graph_category passenger + graph_title Passenger queues + graph_vlabel count -global.label global -END + global.label global + END exit 0 end diff --git a/cookbooks/munin/files/default/plugins/passenger_requests b/cookbooks/munin/files/default/plugins/passenger_requests index 1e34fc70f..3eeb776d6 100755 --- a/cookbooks/munin/files/default/plugins/passenger_requests +++ b/cookbooks/munin/files/default/plugins/passenger_requests @@ -3,17 +3,17 @@ require "English" def output_config - puts <<-END -graph_args --base 1000 -graph_category passenger -graph_title Passenger requests -graph_vlabel requests / ${graph_period} + puts <<~END + graph_args --base 1000 + graph_category passenger + graph_title Passenger requests + graph_vlabel requests / ${graph_period} -requests.label requests -requests.type DERIVE -requests.max 1000000 -requests.min 0 -END + requests.label requests + requests.type DERIVE + requests.max 1000000 + requests.min 0 + END exit 0 end diff --git a/cookbooks/mysql/recipes/default.rb b/cookbooks/mysql/recipes/default.rb index 427081239..9c35682fd 100644 --- a/cookbooks/mysql/recipes/default.rb +++ b/cookbooks/mysql/recipes/default.rb @@ -42,7 +42,7 @@ end package "libdbd-mysql-perl" package "libcache-cache-perl" -%w( +%w[ commands connections files handler_read handler_tmp handler_transaction handler_write innodb_bpool innodb_bpool_act innodb_history_list_length innodb_insert_buf innodb_io innodb_io_pend innodb_log innodb_queries @@ -50,15 +50,15 @@ package "libcache-cache-perl" innodb_tnx max_mem mrr myisam_indexes network_traffic performance qcache qcache_mem select_types slow sorts table_definitions table_locks tmp_tables -).each do |stat| +].each do |stat| munin_plugin "mysql_#{stat}" do target "mysql_" end end -%w( +%w[ bin_relay_log files_tables replication -).each do |stat| +].each do |stat| munin_plugin "mysql_#{stat}" do action :delete end diff --git a/cookbooks/networking/recipes/default.rb b/cookbooks/networking/recipes/default.rb index 16dd48269..697f2c34e 100644 --- a/cookbooks/networking/recipes/default.rb +++ b/cookbooks/networking/recipes/default.rb @@ -216,7 +216,7 @@ firewall_rule "limit-icmp-echo" do rate_limit "s:1/sec:5" end -%w(ucl ic bm aws).each do |zone| +%w[ucl ic bm aws].each do |zone| firewall_rule "accept-openvpn-#{zone}" do action :accept family :inet diff --git a/cookbooks/nominatim/recipes/default.rb b/cookbooks/nominatim/recipes/default.rb index e930ee47c..e6d793afd 100644 --- a/cookbooks/nominatim/recipes/default.rb +++ b/cookbooks/nominatim/recipes/default.rb @@ -274,7 +274,7 @@ template "/etc/init.d/nominatim-update" do variables :source_directory => source_directory end -%w(backup-nominatim vacuum-db-nominatim).each do |fname| +%w[backup-nominatim vacuum-db-nominatim].each do |fname| template "/usr/local/bin/#{fname}" do source "#{fname}.erb" owner "root" diff --git a/cookbooks/ntp/metadata.rb b/cookbooks/ntp/metadata.rb index d1906c34c..484d0d23d 100644 --- a/cookbooks/ntp/metadata.rb +++ b/cookbooks/ntp/metadata.rb @@ -8,7 +8,7 @@ version "0.8.2" recipe "ntp", "Installs and configures ntp either as a server or client" -%w(ubuntu debian redhat centos fedora).each do |os| +%w[ubuntu debian redhat centos fedora].each do |os| supports os end diff --git a/cookbooks/ntp/recipes/default.rb b/cookbooks/ntp/recipes/default.rb index 29f79d693..cdf3b5a96 100644 --- a/cookbooks/ntp/recipes/default.rb +++ b/cookbooks/ntp/recipes/default.rb @@ -51,7 +51,7 @@ template "/etc/ntp.conf" do notifies :restart, "service[ntp]" end -munin_plugins = %w(ntp_kernel_err ntp_kernel_pll_freq ntp_kernel_pll_off ntp_offset) +munin_plugins = %w[ntp_kernel_err ntp_kernel_pll_freq ntp_kernel_pll_off ntp_offset] munin_plugin "ntp_kernel_err" munin_plugin "ntp_kernel_pll_freq" diff --git a/cookbooks/piwik/attributes/default.rb b/cookbooks/piwik/attributes/default.rb index ba7ade377..16089ca74 100644 --- a/cookbooks/piwik/attributes/default.rb +++ b/cookbooks/piwik/attributes/default.rb @@ -1,5 +1,5 @@ default[:piwik][:version] = "3.0.4" -default[:piwik][:plugins] = %w( +default[:piwik][:plugins] = %w[ Actions API BulkTracking Contents CoreAdminHome CoreConsole CoreHome CorePluginsAdmin CoreUpdater CoreVisualizations CustomVariables Dashboard DevicesDetection DevicePlugins DoNotTrack Events Feedback Goals @@ -8,4 +8,4 @@ default[:piwik][:plugins] = %w( SegmentEditor SEO SitesManager Transitions UserCountry UserCountryMap UserLanguage UsersManager Widgetize VisitFrequency VisitorInterest VisitsSummary VisitTime -) +] diff --git a/cookbooks/planet/files/default/replication-bin/replicate-changesets b/cookbooks/planet/files/default/replication-bin/replicate-changesets old mode 100644 new mode 100755 index a5312e1e6..3cf54291f --- a/cookbooks/planet/files/default/replication-bin/replicate-changesets +++ b/cookbooks/planet/files/default/replication-bin/replicate-changesets @@ -100,7 +100,7 @@ class ChangesetBuilder xml["comments_count"] = res.num_tuples.to_s # early return if there aren't any comments - return unless res.num_tuples > 0 + return unless res.num_tuples.positive? discussion = XML::Node.new("discussion") res.each do |row| @@ -167,7 +167,7 @@ class Replicator new_ids = @conn .exec("select distinct changeset_id from changeset_comments where created_at >= '#{last_run}' and created_at < '#{@now}' and visible") .map { |row| row["changeset_id"].to_i } - .select { |c_id| !cs_ids.include?(c_id) } + .reject { |c_id| cs_ids.include?(c_id) } new_ids.each do |id| @conn @@ -277,7 +277,6 @@ class Replicator move_tmp_files_into_place! fl.flock(File::LOCK_UN) - rescue STDERR.puts("Error! Couldn't update state.") fl.flock(File::LOCK_UN) diff --git a/cookbooks/planet/recipes/dump.rb b/cookbooks/planet/recipes/dump.rb index 44f1d6e59..0eb5cef0d 100644 --- a/cookbooks/planet/recipes/dump.rb +++ b/cookbooks/planet/recipes/dump.rb @@ -20,7 +20,7 @@ node.default[:incron][:planetdump] = { :user => "www-data", :path => "/store/backup", - :events => %w(IN_CREATE IN_MOVED_TO), + :events => %w[IN_CREATE IN_MOVED_TO], :command => "/usr/local/bin/planetdump $#" } diff --git a/cookbooks/postgresql/providers/munin.rb b/cookbooks/postgresql/providers/munin.rb index 986c11f44..efa0a8b4d 100644 --- a/cookbooks/postgresql/providers/munin.rb +++ b/cookbooks/postgresql/providers/munin.rb @@ -28,7 +28,7 @@ action :create do database = new_resource.database if cluster - %w(cache connections locks querylength scans size transactions tuples).each do |plugin| + %w[cache connections locks querylength scans size transactions tuples].each do |plugin| munin_plugin "postgres_#{plugin}_#{database}:#{suffix}" do target "postgres_#{plugin}_" conf "munin.erb" @@ -45,7 +45,7 @@ end action :delete do database = new_resource.database - %w(cache connections locks querylength scans size transactions tuples).each do |plugin| + %w[cache connections locks querylength scans size transactions tuples].each do |plugin| munin_plugin "postgres_#{plugin}_#{database}:#{suffix}" do action :delete restart_munin false diff --git a/cookbooks/squid/recipes/default.rb b/cookbooks/squid/recipes/default.rb index 731cbdd83..54e6e4af4 100644 --- a/cookbooks/squid/recipes/default.rb +++ b/cookbooks/squid/recipes/default.rb @@ -72,7 +72,7 @@ log "squid-restart" do notifies :restart, "service[squid]" only_if do IO.popen(["squidclient", "--host=127.0.0.1", "--port=80", "mgr:counters"]) do |io| - io.each.grep(/^[a-z][a-z_.]+ = -[0-9]+$/).count > 0 + io.each.grep(/^[a-z][a-z_.]+ = -[0-9]+$/).count.positive? end end end diff --git a/cookbooks/ssl/recipes/default.rb b/cookbooks/ssl/recipes/default.rb index 328ba8bab..536110d3e 100644 --- a/cookbooks/ssl/recipes/default.rb +++ b/cookbooks/ssl/recipes/default.rb @@ -20,7 +20,7 @@ package "openssl" package "ssl-cert" -%w(letsencrypt dhparam).each do |certificate| +%w[letsencrypt dhparam].each do |certificate| cookbook_file "/etc/ssl/certs/#{certificate}.pem" do owner "root" group "root" diff --git a/cookbooks/systemd/resources/service.rb b/cookbooks/systemd/resources/service.rb index 664304da8..e7779fae7 100644 --- a/cookbooks/systemd/resources/service.rb +++ b/cookbooks/systemd/resources/service.rb @@ -25,7 +25,7 @@ property :after, [String, Array] property :wants, [String, Array] property :type, String, :default => "simple", - :is => %w(simple forking oneshot dbus notify idle) + :is => %w[simple forking oneshot dbus notify idle] property :limit_nofile, Integer property :environment, Hash, :default => {} property :environment_file, [String, Hash] @@ -40,14 +40,14 @@ property :exec_reload, String property :runtime_directory, String property :runtime_directory_mode, Integer property :standard_input, String, - :is => %w(null tty tty-force tty-fail socket) + :is => %w[null tty tty-force tty-fail socket] property :standard_output, String, - :is => %w(inherit null tty journal syslog kmsg journal+console syslog+console kmsg+console socket) + :is => %w[inherit null tty journal syslog kmsg journal+console syslog+console kmsg+console socket] property :standard_error, String, - :is => %w(inherit null tty journal syslog kmsg journal+console syslog+console kmsg+console socket) + :is => %w[inherit null tty journal syslog kmsg journal+console syslog+console kmsg+console socket] property :success_exit_status, [Integer, String, Array] property :restart, String, - :is => %w(on-success on-failure on-abnormal on-watchdog on-abort always) + :is => %w[on-success on-failure on-abnormal on-watchdog on-abort always] property :private_tmp, [TrueClass, FalseClass] property :private_devices, [TrueClass, FalseClass] property :private_network, [TrueClass, FalseClass] diff --git a/cookbooks/taginfo/recipes/default.rb b/cookbooks/taginfo/recipes/default.rb index 57ccb3d40..cd3262c7f 100644 --- a/cookbooks/taginfo/recipes/default.rb +++ b/cookbooks/taginfo/recipes/default.rb @@ -45,7 +45,7 @@ ruby_version = node[:passenger][:ruby_version] package "ruby#{ruby_version}" -%w(json sqlite3 sinatra sinatra-r18n rack-contrib).each do |gem| +%w[json sqlite3 sinatra sinatra-r18n rack-contrib].each do |gem| gem_package gem do gem_binary "gem#{ruby_version}" end @@ -181,7 +181,7 @@ node[:taginfo][:sites].each do |site| subscribes :run, "git[#{directory}/osmium-tool]" end - %w(taginfo/web/tmp bin data data/old download sources planet planet/log planet/replication).each do |dir| + %w[taginfo/web/tmp bin data data/old download sources planet planet/log planet/replication].each do |dir| directory "#{directory}/#{dir}" do owner "taginfo" group "taginfo" diff --git a/cookbooks/tile/recipes/default.rb b/cookbooks/tile/recipes/default.rb index 679d2a308..6cdf6190f 100644 --- a/cookbooks/tile/recipes/default.rb +++ b/cookbooks/tile/recipes/default.rb @@ -376,7 +376,7 @@ postgresql_extension "hstore" do database "gis" end -%w(geography_columns planet_osm_nodes planet_osm_rels planet_osm_ways raster_columns raster_overviews spatial_ref_sys).each do |table| +%w[geography_columns planet_osm_nodes planet_osm_rels planet_osm_ways raster_columns raster_overviews spatial_ref_sys].each do |table| postgresql_table table do cluster node[:tile][:database][:cluster] database "gis" @@ -385,7 +385,7 @@ end end end -%w(geometry_columns planet_osm_line planet_osm_point planet_osm_polygon planet_osm_roads).each do |table| +%w[geometry_columns planet_osm_line planet_osm_point planet_osm_polygon planet_osm_roads].each do |table| postgresql_table table do cluster node[:tile][:database][:cluster] database "gis" diff --git a/cookbooks/web/recipes/cgimap.rb b/cookbooks/web/recipes/cgimap.rb index 0875804cd..8303955c2 100644 --- a/cookbooks/web/recipes/cgimap.rb +++ b/cookbooks/web/recipes/cgimap.rb @@ -63,7 +63,7 @@ systemd_service "cgimap" do pid_file "#{node[:web][:pid_directory]}/cgimap.pid" end -if %w(database_offline api_offline).include?(node[:web][:status]) +if %w[database_offline api_offline].include?(node[:web][:status]) service "cgimap" do action :stop end diff --git a/cookbooks/web/recipes/gpx.rb b/cookbooks/web/recipes/gpx.rb index f74ac5036..59d5bc1de 100644 --- a/cookbooks/web/recipes/gpx.rb +++ b/cookbooks/web/recipes/gpx.rb @@ -79,7 +79,7 @@ systemd_service "gpx-import" do pid_file "#{pid_directory}/gpx-import.pid" end -if %w(database_offline database_readonly gpx_offline).include?(node[:web][:status]) +if %w[database_offline database_readonly gpx_offline].include?(node[:web][:status]) service "gpx-import" do action :stop end diff --git a/cookbooks/web/recipes/rails.rb b/cookbooks/web/recipes/rails.rb index 725f3b746..14eacc50a 100644 --- a/cookbooks/web/recipes/rails.rb +++ b/cookbooks/web/recipes/rails.rb @@ -48,7 +48,7 @@ end rails_directory = "#{node[:web][:base_directory]}/rails" piwik_configuration = data_bag_item("web", "piwik").to_hash.reject do |k, _| - %w(chef_type data_bag id).include?(k) + %w[chef_type data_bag id].include?(k) end rails_port "www.openstreetmap.org" do diff --git a/hooks/pre-commit b/hooks/pre-commit index 7c7655e5d..cb7bc82d5 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -3,7 +3,7 @@ ok = true if IO.popen(["git", "ls-files", "--unmerged"]).read.empty? - need_stash = !IO.popen(%w(git diff)).read.empty? + need_stash = !IO.popen(%w[git diff]).read.empty? system("git", "stash", "save", "--keep-index", "--quiet") if need_stash diff --git a/roles/bytemark.rb b/roles/bytemark.rb index 6d539ff5f..404d84764 100644 --- a/roles/bytemark.rb +++ b/roles/bytemark.rb @@ -27,7 +27,7 @@ default_attributes( } }, :web => { - :backends => %w(rails4 rails5), + :backends => %w[rails4 rails5], :fileserver => "grisu", :readonly_database_host => "katla.bm.openstreetmap.org" } diff --git a/roles/dulcy.rb b/roles/dulcy.rb index 29cf0bb38..355f98cc6 100644 --- a/roles/dulcy.rb +++ b/roles/dulcy.rb @@ -42,7 +42,7 @@ default_attributes( :nominatim => { :state => "standalone", :enable_backup => false, - :dbadmins => %w(lonvia tomh), + :dbadmins => %w[lonvia tomh], :dbcluster => "9.6/main", :flatnode_file => "/ssd/nominatim/nodes.store", :logdir => "/ssd/nominatim/log", diff --git a/roles/grisu.rb b/roles/grisu.rb index 613f9f27c..ebc62416b 100644 --- a/roles/grisu.rb +++ b/roles/grisu.rb @@ -10,7 +10,7 @@ default_attributes( :family => :inet, :address => "10.0.32.20", :bond => { - :slaves => %w(em1 em2) + :slaves => %w[em1 em2] } }, :external_ipv4 => { diff --git a/roles/ic.rb b/roles/ic.rb index 4041d2b36..33e99624b 100644 --- a/roles/ic.rb +++ b/roles/ic.rb @@ -30,7 +30,7 @@ default_attributes( } }, :web => { - :backends => %w(rails1 rails2 rails3), + :backends => %w[rails1 rails2 rails3], :fileserver => "ironbelly", :readonly_database_host => "karm.ic.openstreetmap.org" } diff --git a/roles/katla.rb b/roles/katla.rb index 399c767b2..4753dd832 100644 --- a/roles/katla.rb +++ b/roles/katla.rb @@ -58,7 +58,7 @@ default_attributes( :family => :inet, :address => "10.0.32.40", :bond => { - :slaves => %w(eth0 eth1) + :slaves => %w[eth0 eth1] } } } diff --git a/roles/ladon.rb b/roles/ladon.rb index f70e0af2b..75da422c8 100644 --- a/roles/ladon.rb +++ b/roles/ladon.rb @@ -15,7 +15,7 @@ default_attributes( :mode => "802.3ad", :miimon => "100", :xmithashpolicy => "layer3+4", - :slaves => %w(eth0 eth1) + :slaves => %w[eth0 eth1] } }, :external_ipv6 => { diff --git a/roles/paulla.rb b/roles/paulla.rb index db4252d5d..3d542df25 100644 --- a/roles/paulla.rb +++ b/roles/paulla.rb @@ -1,4 +1,5 @@ # coding: utf-8 + name "paulla" description "Role applied to all servers at PauLLA" diff --git a/roles/pummelzacken.rb b/roles/pummelzacken.rb index f5a573d47..a7ccf2e5e 100644 --- a/roles/pummelzacken.rb +++ b/roles/pummelzacken.rb @@ -33,7 +33,7 @@ default_attributes( }, :nominatim => { :state => "standalone", - :dbadmins => %w(lonvia tomh), + :dbadmins => %w[lonvia tomh], :dbcluster => "9.5/main", :flatnode_file => "/ssd/nominatim/nodes.store", :tablespaces => { diff --git a/roles/spike-04.rb b/roles/spike-04.rb index 343a5c591..493694765 100644 --- a/roles/spike-04.rb +++ b/roles/spike-04.rb @@ -10,7 +10,7 @@ default_attributes( :family => :inet, :address => "10.0.32.21", :bond => { - :slaves => %w(em1 em2) + :slaves => %w[em1 em2] } }, :external_ipv4 => { diff --git a/roles/spike-05.rb b/roles/spike-05.rb index 6df29d9cb..7710900aa 100644 --- a/roles/spike-05.rb +++ b/roles/spike-05.rb @@ -10,7 +10,7 @@ default_attributes( :family => :inet, :address => "10.0.32.22", :bond => { - :slaves => %w(em1 em2) + :slaves => %w[em1 em2] } }, :external_ipv4 => { diff --git a/roles/teleservice.rb b/roles/teleservice.rb index 70e0e5bde..6bb0b45da 100644 --- a/roles/teleservice.rb +++ b/roles/teleservice.rb @@ -1,4 +1,5 @@ # coding: utf-8 + name "teleservice" description "Role applied to all servers at Teleservice" diff --git a/roles/thorn-04.rb b/roles/thorn-04.rb index 1487ae3d2..8954a8c34 100644 --- a/roles/thorn-04.rb +++ b/roles/thorn-04.rb @@ -10,7 +10,7 @@ default_attributes( :family => :inet, :address => "10.0.32.41", :bond => { - :slaves => %w(em1 em2) + :slaves => %w[em1 em2] } } } diff --git a/roles/thorn-05.rb b/roles/thorn-05.rb index e36e22017..e0b20913d 100644 --- a/roles/thorn-05.rb +++ b/roles/thorn-05.rb @@ -10,7 +10,7 @@ default_attributes( :family => :inet, :address => "10.0.32.42", :bond => { - :slaves => %w(em1 em2) + :slaves => %w[em1 em2] } } } diff --git a/roles/tyan-s7010.rb b/roles/tyan-s7010.rb index 86ef45b0e..c6e21bd9a 100644 --- a/roles/tyan-s7010.rb +++ b/roles/tyan-s7010.rb @@ -3,7 +3,7 @@ description "Role applied to machines using the Tyan S7010 motherboard" default_attributes( :hardware => { - :modules => %w(i2c_i801 jc42 w83793), + :modules => %w[i2c_i801 jc42 w83793], :sensors => { "jc42-*" => { :temps => { diff --git a/roles/web.rb b/roles/web.rb index dce003b3d..7427f0526 100644 --- a/roles/web.rb +++ b/roles/web.rb @@ -15,7 +15,7 @@ default_attributes( }, :web => { :status => "online", - :memcached_servers => %w(rails1.ic rails2.ic rails3.ic) + :memcached_servers => %w[rails1.ic rails2.ic rails3.ic] } ) -- 2.43.2