synced_folders/nfs: verify_installed option [GH-5269]
This commit is contained in:
parent
425e9aa6cd
commit
964f340f09
|
@ -6,6 +6,7 @@ module VagrantPlugins
|
|||
attr_accessor :functional
|
||||
attr_accessor :map_uid
|
||||
attr_accessor :map_gid
|
||||
attr_accessor :verify_installed
|
||||
|
||||
def initialize
|
||||
super
|
||||
|
@ -13,12 +14,14 @@ module VagrantPlugins
|
|||
@functional = UNSET_VALUE
|
||||
@map_uid = UNSET_VALUE
|
||||
@map_gid = UNSET_VALUE
|
||||
@verify_installed = UNSET_VALUE
|
||||
end
|
||||
|
||||
def finalize!
|
||||
@functional = true if @functional == UNSET_VALUE
|
||||
@map_uid = :auto if @map_uid == UNSET_VALUE
|
||||
@map_gid = :auto if @map_gid == UNSET_VALUE
|
||||
@verify_installed = true if @verify_installed == UNSET_VALUE
|
||||
end
|
||||
|
||||
def to_s
|
||||
|
|
|
@ -43,6 +43,7 @@ module VagrantPlugins
|
|||
raise Vagrant::Errors::NFSNoHostIP if !nfsopts[:nfs_host_ip]
|
||||
raise Vagrant::Errors::NFSNoGuestIP if !nfsopts[:nfs_machine_ip]
|
||||
|
||||
if machine.config.nfs.verify_installed
|
||||
if machine.guest.capability?(:nfs_client_installed)
|
||||
installed = machine.guest.capability(:nfs_client_installed)
|
||||
if !installed
|
||||
|
@ -52,6 +53,7 @@ module VagrantPlugins
|
|||
machine.guest.capability(:nfs_client_install)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
machine_ip = nfsopts[:nfs_machine_ip]
|
||||
machine_ip = [machine_ip] if !machine_ip.is_a?(Array)
|
||||
|
|
Loading…
Reference in New Issue