Skip to content

Commit

Permalink
[monitor] Fix issues with directory creation on windows (#678)
Browse files Browse the repository at this point in the history
* Fix process directory permisions on windows

* Remove unreachable else statement

Co-authored-by: Kylian Serrania <kylian.serrania@datadoghq.com>
  • Loading branch information
2 people authored and kbogtob committed Dec 31, 2019
1 parent 59bd590 commit e5946b6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions resources/monitor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@

if Chef::Datadog.agent_major_version(node) != 5
directory ::File.join(yaml_dir, "#{new_resource.name}.d") do
owner 'dd-agent'
group 'dd-agent'
mode '755'
if node['platform_family'] == 'windows'
inherits true # Agent 6/7 rely on inheritance being enabled. Reset it in case it was disabled when installing Agent 5.
else
owner 'dd-agent'
group 'dd-agent'
mode '755'
end
end
yaml_file = ::File.join(yaml_dir, "#{new_resource.name}.d", 'conf.yaml')
else
Expand Down

0 comments on commit e5946b6

Please sign in to comment.