fix the import issue when 'box_ignore_box_vagrantfile' is set, the box object should never be null.

This commit is contained in:
Alex Wu 2017-01-10 17:39:28 +08:00 committed by Brian Cain
parent 710b8da953
commit a45e62cacd
No known key found for this signature in database
GPG Key ID: 43D51080D357A001
1 changed files with 2 additions and 2 deletions

View File

@ -191,11 +191,11 @@ module Vagrant
local_keys = keys.dup local_keys = keys.dup
# Load the box Vagrantfile, if there is one # Load the box Vagrantfile, if there is one
if config.vm.box && !config.vm.box_ignore_box_vagrantfile && boxes if config.vm.box && boxes
box = boxes.find(config.vm.box, box_formats, config.vm.box_version) box = boxes.find(config.vm.box, box_formats, config.vm.box_version)
if box if box
box_vagrantfile = find_vagrantfile(box.directory) box_vagrantfile = find_vagrantfile(box.directory)
if box_vagrantfile if box_vagrantfile && !config.vm.box_ignore_box_vagrantfile
box_config_key = box_config_key =
"#{boxes.object_id}_#{box.name}_#{box.provider}".to_sym "#{boxes.object_id}_#{box.name}_#{box.provider}".to_sym
@loader.set(box_config_key, box_vagrantfile) @loader.set(box_config_key, box_vagrantfile)