From 5f4a7f1967dbcfd88312210b9b9bdb9c4c5e9e32 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Sun, 20 Jul 2014 20:34:14 -0300 Subject: [PATCH] Make use of the Vagrantfile configured base box name instead of getting it from the Box object (which might be nil) Closes GH-86 --- lib/vagrant-cachier/action/configure_bucket_root.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/vagrant-cachier/action/configure_bucket_root.rb b/lib/vagrant-cachier/action/configure_bucket_root.rb index 0630378..e1b5480 100644 --- a/lib/vagrant-cachier/action/configure_bucket_root.rb +++ b/lib/vagrant-cachier/action/configure_bucket_root.rb @@ -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