kernel/v2: box is optional if clone is set

This commit is contained in:
Mitchell Hashimoto 2015-10-08 12:41:16 -04:00
parent f0ddac8c9a
commit dbcc936a71
2 changed files with 4 additions and 1 deletions

View File

@ -559,7 +559,7 @@ module VagrantPlugins
def validate(machine)
errors = _detected_errors
if !box && !machine.provider_options[:box_optional]
if !box && !clone && !machine.provider_options[:box_optional]
errors << I18n.t("vagrant.config.vm.box_missing")
end

View File

@ -7,6 +7,9 @@ module VagrantPlugins
end
def call(env)
# If we cloned, we don't need a base mac, it is already set!
return @app.call(env) if env[:machine].config.vm.clone
raise Vagrant::Errors::VMBaseMacNotSpecified if !env[:machine].config.vm.base_mac
# Create the proc which we want to use to modify the virtual machine