From d6aee779411adefadfdedc615d46e1ad549c524c Mon Sep 17 00:00:00 2001 From: David Joos Date: Mon, 16 May 2022 15:33:35 +0100 Subject: [PATCH 1/2] Whenever available (>= Chef Infra client 17.3.49) make use of the Chef `render_toml` render helper, preventing a "NameError: uninitialized constant TOML" on newer Chef Infra client versions --- resources/config.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/resources/config.rb b/resources/config.rb index 89f93d6..fdbad25 100644 --- a/resources/config.rb +++ b/resources/config.rb @@ -8,10 +8,16 @@ default_action :create action :create do - require 'toml' + if Version.new(Chef::VERSION) >= Version.new('17.3.48') + content = render_toml(new_resource.config) + else + require 'toml' + + content = TOML::Generator.new(new_resource.config).body + end file new_resource.path do - content TOML::Generator.new(new_resource.config).body + content content end end From 5d6274a38c1c4f31f2581a2673210dcfe7efec35 Mon Sep 17 00:00:00 2001 From: David Joos Date: Mon, 16 May 2022 15:38:39 +0100 Subject: [PATCH 2/2] install a newer InfluxDB client version, which addresses the "ArgumentError: wrong number of arguments (given 1, expected 0)" error when using 0.6.1 --- recipes/default.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/default.rb b/recipes/default.rb index 152ad64..7ee794b 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -7,7 +7,7 @@ end chef_gem 'influxdb' do - version '0.6.1' + version '0.8.1' compile_time false if respond_to?(:compile_time) end