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:
commit
cb51b4fe7f
|
@ -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.
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue