Display a warning using Vagrant's UI in case enable_nfs is set

This commit is contained in:
Fabio Rehm 2014-02-01 02:35:48 -02:00
parent bfdb2c53f3
commit 5c35320800

View file

@ -17,14 +17,18 @@ module VagrantPlugins
end end
def enable_nfs=(value) def enable_nfs=(value)
puts "The `enable_nfs` config for vagrant-cachier has been deprecated " \ # Flag to raise warning on #validate
"and will be removed on 0.7.0, please use " \ @_enable_nfs_set = true
"`synced_folder_opts = { type: 'nfs' }` instead." @synced_folder_opts = { type: 'nfs', nfs: true } if value
@synced_folder_opts = { type: 'nfs' } if value
end end
def validate(machine) def validate(machine)
if @_enable_nfs_set
machine.ui.warn "The `enable_nfs` config for vagrant-cachier has been deprecated " \
"and will be removed on 0.7.0, please use " \
"`synced_folder_opts = { type: 'nfs' }` instead."
end
errors = _detected_errors errors = _detected_errors
if enabled? && ! ALLOWED_SCOPES.include?(@scope.to_s) if enabled? && ! ALLOWED_SCOPES.include?(@scope.to_s)