vaguerent/plugins/provisioners/chef/command_builder_windows.rb
Shawn Neal 99ce95198b First pass at integrating new WinRM elevated execution wrapper
- Removed a lot of the Windows special casing from Chef runs
- Don't attempt to use @config.binary_env since we don't properly pass this along to Chef
2014-04-26 21:07:26 -07:00

34 lines
896 B
Ruby

module VagrantPlugins
module Chef
class CommandBuilderWindows < CommandBuilder
def build_command
"#{chef_binary_path} #{chef_arguments}"
end
protected
def chef_binary_path
binary_path = "chef-#{@client_type}"
binary_path = win_path(File.join(@config.binary_path, binary_path)) if @config.binary_path
binary_path
end
def chef_arguments
chef_arguments = "-c #{provisioning_path("#{@client_type}.rb")}"
chef_arguments << " -j #{provisioning_path("dna.json")}"
chef_arguments << " #{@config.arguments}" if @config.arguments
chef_arguments.strip
end
def provisioning_path(file)
win_path(File.join(@config.provisioning_path, file))
end
def win_path(path)
path.gsub!("/", "\\")
"c:#{path}" if path.start_with?("\\")
end
end
end
end