Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tool_version being unknown in install_info #692

Merged
merged 1 commit into from
Apr 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,6 @@
$local_integrations = $integrations
}

$_puppetversion = lookup({ 'name' => '::puppetversion', 'default_value' => 'unknown'})

include datadog_agent::params
case upcase($log_level) {
'CRITICAL': { $_loglevel = 'CRITICAL' }
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/datadog_agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1701,7 +1701,7 @@
it 'adds an install_info' do
expect(install_info['install_method']).to match(
'tool' => 'puppet',
'tool_version' => %r{^puppet-(\d+\.\d+\.\d+|unknown)$},
'tool_version' => %r{^puppet-unknown$}, # puppetversion is not set in tests, this field has to be tested manually
'installer_version' => %r{^datadog_module-\d+\.\d+\.\d+$},
)
end
Expand Down
2 changes: 1 addition & 1 deletion templates/install_info.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
install_method:
tool: puppet
tool_version: puppet-<%= @_puppetversion %>
tool_version: puppet-<%= @facts['puppetversion'] or 'unknown' %>
installer_version: datadog_module-<%= @module_metadata['version'] %>