From: Tom Hughes Date: Sun, 4 Dec 2022 18:58:51 +0000 (+0000) Subject: Fix some cookstyle warnings X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/2e6f821bc9ac4912940bf4e0dab98bb2df8439b5?ds=sidebyside Fix some cookstyle warnings --- diff --git a/cookbooks/chef/libraries/cpu.rb b/cookbooks/chef/libraries/cpu.rb index a7992a4ca..1e2d8447f 100644 --- a/cookbooks/chef/libraries/cpu.rb +++ b/cookbooks/chef/libraries/cpu.rb @@ -2,7 +2,7 @@ module OpenStreetMap module Mixin module CPU def cpu_cores - [self.dig("cpu", "total").to_i, self.dig("cpu", "cores").to_i, 4].max + [dig("cpu", "total").to_i, dig("cpu", "cores").to_i, 4].max end end end diff --git a/cookbooks/chef/libraries/edit_file.rb b/cookbooks/chef/libraries/edit_file.rb index f7c23178c..7de56267f 100644 --- a/cookbooks/chef/libraries/edit_file.rb +++ b/cookbooks/chef/libraries/edit_file.rb @@ -12,4 +12,4 @@ module OpenStreetMap end end -Chef::Recipe.include(OpenStreetMap::Mixin::EditFile) +Chef::DSL::Recipe.include(OpenStreetMap::Mixin::EditFile) diff --git a/cookbooks/chef/libraries/persistent_token.rb b/cookbooks/chef/libraries/persistent_token.rb index e6f873507..944f19363 100644 --- a/cookbooks/chef/libraries/persistent_token.rb +++ b/cookbooks/chef/libraries/persistent_token.rb @@ -15,4 +15,4 @@ module OpenStreetMap end end -Chef::Recipe.include(OpenStreetMap::Mixin::PersistentToken) +Chef::DSL::Recipe.include(OpenStreetMap::Mixin::PersistentToken) diff --git a/cookbooks/prometheus/recipes/default.rb b/cookbooks/prometheus/recipes/default.rb index 7b281b03c..0806061e6 100644 --- a/cookbooks/prometheus/recipes/default.rb +++ b/cookbooks/prometheus/recipes/default.rb @@ -102,7 +102,7 @@ prometheus_exporter "node" do user "root" proc_subset "all" protect_clock false - restrict_address_families ["AF_UNIX", "AF_NETLINK"] + restrict_address_families %w[AF_UNIX AF_NETLINK] system_call_filter ["@system-service", "@clock"] options %w[ --collector.textfile.directory=/var/lib/prometheus/node-exporter