Only prepare NFS settings for VirtualBox if NFS is enabled
This commit is contained in:
parent
91ebe323f1
commit
c94f61d274
|
@ -10,11 +10,22 @@ module VagrantPlugins
|
|||
def call(env)
|
||||
@app.call(env)
|
||||
|
||||
using_nfs = false
|
||||
env[:machine].config.vm.synced_folders.each do |id, opts|
|
||||
if opts[:nfs]
|
||||
using_nfs = true
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if using_nfs
|
||||
@logger.info("Using NFS, preparing NFS settings by reading host IP and machine IP")
|
||||
env[:nfs_host_ip] = read_host_ip(env[:machine])
|
||||
env[:nfs_machine_ip] = read_machine_ip(env[:machine])
|
||||
|
||||
raise Vagrant::Errors::NFSNoHostonlyNetwork if !env[:nfs_machine_ip]
|
||||
end
|
||||
end
|
||||
|
||||
# Returns the IP address of the first host only network adapter
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue