Skip to content
Closed
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
11 changes: 11 additions & 0 deletions recipes/_install-linux.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@
package_retries = node['datadog']['agent_package_retries']
package_retry_delay = node['datadog']['agent_package_retry_delay']

# Remove Python bytecode cache dir prior to installing/upgrading Agent (Linux only)
directory '/opt/datadog-agent/python-scripts/__pycache__' do
action :delete
recursive true
ignore_failure true
only_if do
platform_family?('debian', 'rhel', 'fedora', 'amazon', 'suse') &&
![:remove, :purge].include?((package_action.is_a?(Symbol) ? package_action : package_action.to_sym))
end
end

# Install the regular package
case node['platform_family']
when 'debian'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,25 @@

# On Linux kernel >= 5.5, Agent 5 disk check fails because of old psutil version, which doesn't have fix
# https://github.com/giampaolo/psutil/commit/2e0952e939d6ab517449314876d8d3488ba5b98b
describe command('/etc/init.d/datadog-agent info | grep -v "API Key is invalid" | grep -v "not sure how to interpret line"'), :if => os[:family] != 'windows' do
describe command('/etc/init.d/datadog-agent info | grep -v "API Key is invalid" | grep -v "not sure how to interpret line" | egrep -v "Unable to validate API Key. Please try again later"'), :if => os[:family] != 'windows' do
its(:exit_status) { should eq 0 }
its(:stdout) { should contain 'OK' }

it 'dumps full output for debugging before ERROR check' do
output = subject.stdout
puts "\n" + "="*80
puts "FULL DATADOG AGENT INFO OUTPUT (#{output.length} chars)"
puts "="*80
puts output
puts "="*80
if output.include?('ERROR')
puts "\nERROR LINES FOUND:"
output.lines.each_with_index do |line, idx|
puts "[#{idx + 1}] #{line}" if line.upcase.include?('ERROR')
end
end
end

its(:stdout) { should_not contain 'ERROR' }
end

Expand Down
Loading