Create data dir only after the machine passes all checks
This commit is contained in:
parent
319175b7f1
commit
c4565b3c99
|
@ -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