Fix #6740: Ansible local provisioner: remove windows drive letter from path

This commit is contained in:
char16t 2015-12-26 21:31:57 +03:00 committed by Valeriy Manenkov
parent 984bc4ab77
commit 07f3d0b00d
1 changed files with 5 additions and 1 deletions

View File

@ -37,7 +37,11 @@ module VagrantPlugins
protected
def check_path(machine, path, test_args, error_message_key = nil)
remote_path = Pathname.new(path).expand_path(@provisioning_path)
remote_path = File.expand_path(path, @provisioning_path)
# Remove drive letter if running on a Windows host
remote_path = remote_path.gsub(/^[a-zA-Z]:/, "")
if machine.communicate.ready? && !machine.communicate.test("test #{test_args} #{remote_path}")
if error_message_key
@errors << I18n.t(error_message_key, path: remote_path, system: "guest")