Make use of the Vagrantfile configured base box name instead of getting it from the Box object (which might be nil)

Closes GH-86
This commit is contained in:
Fabio Rehm 2014-07-20 20:34:14 -03:00
parent 183b2b55d8
commit 5f4a7f1967

View file

@ -33,13 +33,17 @@ module VagrantPlugins
def cache_root
@cache_root ||= case @env[:machine].config.cache.scope.to_sym
when :box
@env[:home_path].join('cache', @env[:machine].box.name)
@env[:home_path].join('cache', box_name)
when :machine
@env[:machine].data_dir.parent.join('cache')
else
raise "Unknown cache scope: '#{@env[:machine].config.cache.scope}'"
end
end
def box_name
@env[:machine].config.vm.box
end
end
end
end