diff options
author | Tim Smith <tsmith@chef.io> | 2019-05-07 15:36:30 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-07 15:36:30 -0700 |
commit | 888f138f5d73794e3e85d1ef0d1b10d9092ba153 (patch) | |
tree | 8a79dff73524b442ccdfd6cf2b07b4a9b47fa95b | |
parent | 60dd24d1888944f9f55d75d7f52fe432a2cd9031 (diff) | |
parent | 34c900c93f091114d5213bc22027bafd2d2704c5 (diff) | |
download | chef-888f138f5d73794e3e85d1ef0d1b10d9092ba153.tar.gz |
Merge pull request #8487 from chef/CHEF-8469/check-for-dir-before-creating
Check for directories on Windows before creating
-rw-r--r-- | lib/chef/knife/bootstrap/templates/windows-chef-client-msi.erb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/chef/knife/bootstrap/templates/windows-chef-client-msi.erb b/lib/chef/knife/bootstrap/templates/windows-chef-client-msi.erb index fd7b48f28d..1ac0b23755 100644 --- a/lib/chef/knife/bootstrap/templates/windows-chef-client-msi.erb +++ b/lib/chef/knife/bootstrap/templates/windows-chef-client-msi.erb @@ -235,13 +235,19 @@ echo Validation key written. <% end -%> <% unless trusted_certs_script.empty? -%> -mkdir <%= bootstrap_directory %>\trusted_certs + @if NOT EXIST <%= bootstrap_directory %>\trusted_certs ( + mkdir <%= bootstrap_directory %>\trusted_certs + ) + ) + <%= trusted_certs_script %> <% end -%> <%# Generate Ohai Hints -%> <% unless @chef_config[:knife][:hints].nil? || @chef_config[:knife][:hints].empty? -%> -mkdir <%= bootstrap_directory %>\ohai\hints + @if NOT EXIST <%= bootstrap_directory %>\ohai\hints ( + mkdir <%= bootstrap_directory %>\ohai\hints + ) <% @chef_config[:knife][:hints].each do |name, hash| -%> > <%= bootstrap_directory %>\ohai\hints\<%= name %>.json ( @@ -259,7 +265,10 @@ mkdir <%= bootstrap_directory %>\ohai\hints ) <% unless client_d.empty? -%> - mkdir <%= bootstrap_directory %>\client.d + @if NOT EXIST <%= bootstrap_directory %>\client.d ( + mkdir <%= bootstrap_directory %>\client.d + ) + <%= client_d %> <% end -%> |