Merge pull request #11099 from briancain/file-provisioner-source-path

Ensure relative path for file provisioner is relative to machines cwd
This commit is contained in:
Brian Cain 2019-10-07 14:28:13 -07:00 committed by GitHub
commit d6f556c83d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@ module VagrantPlugins
class Provisioner < Vagrant.plugin("2", :provisioner)
def provision
@machine.communicate.tap do |comm|
source = File.expand_path(config.source)
source = File.expand_path(config.source, @machine.env.cwd)
destination = expand_guest_path(config.destination)
# If the source is a directory determine if any path modifications

View File

@ -65,7 +65,7 @@ describe VagrantPlugins::FileUpload::Provisioner do
allow(config).to receive(:destination).and_return("/foo/bar")
expect(communicator).to receive(:upload).with(
File.expand_path("source"), "/foo/bar")
File.expand_path("#{machine.env.cwd}/source"), "/foo/bar")
subject.provision
end