Merge pull request #5334 from legal90/fix-data-dir-creation

Create machine data directory only after the machine will be checked
This commit is contained in:
Mitchell Hashimoto 2015-07-06 16:33:33 -06:00
commit cb51b4fe7f
2 changed files with 4 additions and 2 deletions

View File

@ -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.

View File

@ -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,