From 5dec34f03707b67f86c8949fd02087c4fcc7bbc1 Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Tue, 13 Oct 2020 16:48:40 +0200 Subject: [PATCH] Explicitly require yaml (#749) Chef 16.5.17 no longer does this for us Should fix #747 --- Gemfile | 1 + Gemfile.lock | 2 ++ recipes/dd-agent.rb | 2 ++ resources/monitor.rb | 2 ++ 4 files changed, 7 insertions(+) diff --git a/Gemfile b/Gemfile index 23ad135a..86c03846 100644 --- a/Gemfile +++ b/Gemfile @@ -6,6 +6,7 @@ gem 'rake' gem 'chef', "= #{chef_version}" gem 'foodcritic', '~> 11.4.0' gem 'cucumber-core', '~> 3.2.1' +gem 'yaml' gem 'chefspec' gem 'berkshelf' gem 'fauxhai-ng', '~> 7.5.1' diff --git a/Gemfile.lock b/Gemfile.lock index 6952e81b..104d5d62 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -359,6 +359,7 @@ GEM winrm (~> 2.0) wisper (2.0.1) wmi-lite (1.0.5) + yaml (0.1.0) zeitwerk (2.3.1) PLATFORMS @@ -382,6 +383,7 @@ DEPENDENCIES rubocop (~> 0.49.1) test-kitchen virtus + yaml BUNDLED WITH 1.17.3 diff --git a/recipes/dd-agent.rb b/recipes/dd-agent.rb index 9b9b42c5..1dfab7fb 100644 --- a/recipes/dd-agent.rb +++ b/recipes/dd-agent.rb @@ -17,6 +17,8 @@ # limitations under the License. # +require 'yaml' # Our erb templates need this + if node['datadog'].include?('agent6') Chef::Log.warn('The boolean "agent6" is no longer used by this cookbook since version 4.0.0. Use "agent_major_version" instead. To keep the previous behaviour pin a 3.x version of the cookbook.') end diff --git a/resources/monitor.rb b/resources/monitor.rb index 4871e48a..05066170 100644 --- a/resources/monitor.rb +++ b/resources/monitor.rb @@ -1,5 +1,7 @@ # Configure a service via its yaml file +require 'yaml' # Our erb templates need this + default_action :add property :cookbook, String, default: 'datadog'