From 2e6f821bc9ac4912940bf4e0dab98bb2df8439b5 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 4 Dec 2022 18:58:51 +0000 Subject: [PATCH] Fix some cookstyle warnings --- cookbooks/chef/libraries/cpu.rb | 2 +- cookbooks/chef/libraries/edit_file.rb | 2 +- cookbooks/chef/libraries/persistent_token.rb | 2 +- cookbooks/prometheus/recipes/default.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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 -- 2.43.2