From 32f7f98ef4925e7244df4ffa23263478722c119a Mon Sep 17 00:00:00 2001 From: Justin Huff Date: Mon, 20 Feb 2012 09:53:09 -0800 Subject: [PATCH] Fix for permissions when re-provisioning chef. https://github.com/mitchellh/vagrant/issues/748 --- lib/vagrant/provisioners/chef.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/vagrant/provisioners/chef.rb b/lib/vagrant/provisioners/chef.rb index b51e0e868..cf80ffc42 100644 --- a/lib/vagrant/provisioners/chef.rb +++ b/lib/vagrant/provisioners/chef.rb @@ -57,7 +57,9 @@ module Vagrant temp.write(config_file) temp.close - env[:vm].channel.upload(temp.path, File.join(config.provisioning_path, filename)) + remote_file = File.join(config.provisioning_path, filename) + env[:vm].channel.sudo("rm #{remote_file}", :error_check => false) + env[:vm].channel.upload(temp.path, remote_file) end def setup_json