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:
parent
183b2b55d8
commit
5f4a7f1967
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue