From c4565b3c996c0da70eb0c2356e6f5fba9bfbd65e Mon Sep 17 00:00:00 2001 From: Mikhail Zholobov Date: Thu, 12 Feb 2015 14:32:16 +0200 Subject: [PATCH] Create data dir only after the machine passes all checks --- lib/vagrant/environment.rb | 2 -- lib/vagrant/vagrantfile.rb | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index b57092b03..fcea6b69f 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -604,10 +604,8 @@ module Vagrant @logger.info("Uncached load of machine.") # Determine the machine data directory and pass it to the machine. - # XXX: Permissions error here. machine_data_path = @local_data_path.join( "machines/#{name}/#{provider}") - FileUtils.mkdir_p(machine_data_path) # Create the machine and cache it for future calls. This will also # return the machine from this method. diff --git a/lib/vagrant/vagrantfile.rb b/lib/vagrant/vagrantfile.rb index 011d16351..16a7bc491 100644 --- a/lib/vagrant/vagrantfile.rb +++ b/lib/vagrant/vagrantfile.rb @@ -70,6 +70,10 @@ module Vagrant # Get the provider configuration from the final loaded configuration provider_config = config.vm.get_provider_config(provider) + # Create machine data directory if it doesn't exist + # XXX: Permissions error here. + FileUtils.mkdir_p(data_path) + # Create the machine and cache it for future calls. This will also # return the machine from this method. return Machine.new(name, provider, provider_cls, provider_config,