Skip to content

Commit 1905885

Browse files
jcarr-sailthrutruthbk
authored andcommitted
Bug Fix: Faulty check on Redhat causes repeat reinstalls of agent. (DataDog#412)
The factor check for old legacy datadag repo was incorrect and would always return true if a file exists yet was empty. This results in one Puppet run removing the agent, then the next Puppet run adding it again.
1 parent ccc513c commit 1905885

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/facter/agent_repo.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
Facter.add('yum_agent6_repo') do
2020
setcode do
2121
yumpath = '/etc/yum.repos.d/datadog6.repo'
22-
File.exist? yumpath or !File.zero? yumpath
22+
File.exist? yumpath and !File.zero? yumpath
2323
end
2424
end
2525

2626
Facter.add('yum_datadog_legacy_repo') do
2727
setcode do
2828
yumpath = '/etc/yum.repos.d/datadog.repo'
29-
File.exist? yumpath or !File.zero? yumpath
29+
File.exist? yumpath and !File.zero? yumpath
3030
end
3131
end

0 commit comments

Comments
 (0)