From f7074314102bc1b0bf3fc4be0b77d8cb35be715b Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 30 Jul 2011 10:55:48 -0700 Subject: [PATCH] Fix remote URL chef solo runs. [closes GH-431] --- CHANGELOG.md | 1 + lib/vagrant/provisioners/chef_solo.rb | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3424c102..91fef12da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Chef client now accepts an empty (`nil`) run list again. [GH-429] - Fix incorrect error message when running `provision` on halted VM. [GH-447] - Checking guest addition versions now ignores OSE. [GH-438] + - Chef solo from a remote URL fixed. [GH-431] ## 0.8.2 (July 22, 2011) diff --git a/lib/vagrant/provisioners/chef_solo.rb b/lib/vagrant/provisioners/chef_solo.rb index 7e7d0c4bb..b5572afa1 100644 --- a/lib/vagrant/provisioners/chef_solo.rb +++ b/lib/vagrant/provisioners/chef_solo.rb @@ -66,7 +66,15 @@ module Vagrant # or VM path. local_path = nil local_path = File.expand_path(path, env.root_path) if type == :host - remote_path = type == :host ? "#{config.provisioning_path}/chef-solo-#{self.class.get_and_update_counter}" : path + remote_path = nil + if type == :host + # Path exists on the host, setup the remote path + remote_path = "#{config.provisioning_path}/chef-solo-#{self.class.get_and_update_counter}" + else + # Path already exists on the virtual machine. Expand it + # relative to where we're provisioning. + remote_path = File.expand_path(path, config.provisioning_path) + end # Return the result [type, local_path, remote_path]