Skip to content

Commit 7bd38d1

Browse files
authoredApr 23, 2021
Fix tool_version being unknown in install_info (#692)
1 parent 66d3465 commit 7bd38d1

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed
 

‎manifests/init.pp

-2
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,6 @@
400400
$local_integrations = $integrations
401401
}
402402

403-
$_puppetversion = lookup({ 'name' => '::puppetversion', 'default_value' => 'unknown'})
404-
405403
include datadog_agent::params
406404
case upcase($log_level) {
407405
'CRITICAL': { $_loglevel = 'CRITICAL' }

‎spec/classes/datadog_agent_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1701,7 +1701,7 @@
17011701
it 'adds an install_info' do
17021702
expect(install_info['install_method']).to match(
17031703
'tool' => 'puppet',
1704-
'tool_version' => %r{^puppet-(\d+\.\d+\.\d+|unknown)$},
1704+
'tool_version' => %r{^puppet-unknown$}, # puppetversion is not set in tests, this field has to be tested manually
17051705
'installer_version' => %r{^datadog_module-\d+\.\d+\.\d+$},
17061706
)
17071707
end

‎templates/install_info.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
install_method:
33
tool: puppet
4-
tool_version: puppet-<%= @_puppetversion %>
4+
tool_version: puppet-<%= @facts['puppetversion'] or 'unknown' %>
55
installer_version: datadog_module-<%= @module_metadata['version'] %>

0 commit comments

Comments
 (0)
Please sign in to comment.