Add support for disabling the plugin [GH-72]
This commit is contained in:
parent
6908b94609
commit
ca8764f938
1 changed files with 10 additions and 6 deletions
|
@ -18,7 +18,6 @@ module VagrantPlugins
|
|||
end
|
||||
|
||||
def enable_nfs=(value)
|
||||
# TODO: Show warning!!!
|
||||
@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.\n"
|
||||
|
@ -38,6 +37,16 @@ module VagrantPlugins
|
|||
{ "vagrant cachier" => errors }
|
||||
end
|
||||
|
||||
def enabled?
|
||||
return @enabled unless @enabled.nil?
|
||||
|
||||
@enabled = (@auto_detect != UNSET_VALUE || @buckets != nil)
|
||||
end
|
||||
|
||||
def disable!
|
||||
@enabled = false
|
||||
end
|
||||
|
||||
def finalize!
|
||||
return unless enabled?
|
||||
|
||||
|
@ -46,11 +55,6 @@ module VagrantPlugins
|
|||
@synced_folder_opts = nil if @synced_folder_opts == UNSET_VALUE
|
||||
@buckets = @buckets ? @buckets.dup : {}
|
||||
end
|
||||
|
||||
def enabled?
|
||||
@enabled ||= @auto_detect != UNSET_VALUE ||
|
||||
@buckets != nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue