From aa46abac373b2540bb8952f539e818d9e25a8a17 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 18 Dec 2013 03:19:15 -0200 Subject: [PATCH] Fix NFS configs for 1.4 while keeping support for < 1.4 as well --- lib/vagrant-cachier/provision_ext.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/vagrant-cachier/provision_ext.rb b/lib/vagrant-cachier/provision_ext.rb index e378d3c..a04b266 100644 --- a/lib/vagrant-cachier/provision_ext.rb +++ b/lib/vagrant-cachier/provision_ext.rb @@ -17,8 +17,12 @@ module VagrantPlugins FileUtils.mkdir_p(cache_root.to_s) unless cache_root.exist? - nfs_flag = env[:machine].config.cache.enable_nfs - env[:machine].config.vm.synced_folder cache_root, '/tmp/vagrant-cache', id: "vagrant-cache", nfs: nfs_flag + synced_folder_opts = {id: "vagrant-cache"} + if env[:machine].config.cache.enable_nfs + # REFACTOR: Drop the `nfs: true` argument once we drop support for Vagrant < 1.4 + synced_folder_opts.merge!({ nfs: true, type: 'nfs' }) + end + env[:machine].config.vm.synced_folder cache_root, '/tmp/vagrant-cache', synced_folder_opts env[:cache_dirs] = []