From 07f3d0b00dabc37281a01c6776eed22daeea7066 Mon Sep 17 00:00:00 2001 From: char16t Date: Sat, 26 Dec 2015 21:31:57 +0300 Subject: [PATCH] Fix #6740: Ansible local provisioner: remove windows drive letter from path --- plugins/provisioners/ansible/config/guest.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/provisioners/ansible/config/guest.rb b/plugins/provisioners/ansible/config/guest.rb index a7f3bf44e..bfd9444ce 100644 --- a/plugins/provisioners/ansible/config/guest.rb +++ b/plugins/provisioners/ansible/config/guest.rb @@ -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")