summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2014-11-10 11:19:15 -0800
committerJay Mundrawala <jdmundrawala@gmail.com>2014-11-10 11:19:15 -0800
commite54f3cfe7a17c23c35408b465ce5e9648396aa88 (patch)
tree8968be5127b76ef40837e072911c97b30eca9278
parentf8df84e6748e7dd71343fd7844255aa37dbfab78 (diff)
downloadchef-jdmundrawala/chef-shell-windows.tar.gz
chef-shell checks platform when looking for client.rb and solo.rb.jdmundrawala/chef-shell-windows
https://github.com/opscode/chef/issues/2380 pointed out that on windows, -c is required with the -z flag because it would assume nix and look in /etc/chef for client.rb
-rw-r--r--lib/chef/shell.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/chef/shell.rb b/lib/chef/shell.rb
index 33c10e22a6..c5b8296c63 100644
--- a/lib/chef/shell.rb
+++ b/lib/chef/shell.rb
@@ -308,9 +308,17 @@ FOOTER
elsif ENV['HOME'] && ::File.exist?(File.join(ENV['HOME'], '.chef', 'chef_shell.rb'))
File.join(ENV['HOME'], '.chef', 'chef_shell.rb')
elsif config[:solo]
- "/etc/chef/solo.rb"
+ if Chef::Platform.windows?
+ "C:\\chef\\solo.rb"
+ else
+ "/etc/chef/solo.rb"
+ end
elsif config[:client]
- "/etc/chef/client.rb"
+ if Chef::Platform.windows?
+ "C:\\chef\\client.rb"
+ else
+ "/etc/chef/client.rb"
+ end
else
nil
end