Merge pull request #4518 from lunetics/master

guests/freebsd: allow NFS version param
This commit is contained in:
Mitchell Hashimoto 2014-10-23 10:03:41 -07:00
commit fca6428ecd
1 changed files with 4 additions and 2 deletions

View File

@ -4,8 +4,10 @@ module VagrantPlugins
class MountNFSFolder class MountNFSFolder
def self.mount_nfs_folder(machine, ip, folders) def self.mount_nfs_folder(machine, ip, folders)
folders.each do |name, opts| folders.each do |name, opts|
machine.communicate.sudo("mkdir -p #{opts[:guestpath]}", {shell: "sh"}) if opts[:nfs_version]
machine.communicate.sudo("mount -t nfs '#{ip}:#{opts[:hostpath]}' '#{opts[:guestpath]}'", {shell: "sh"}) nfs_version_mount_option="-o nfsv#{opts[:nfs_version]}"
end
machine.communicate.sudo("mount -t nfs #{nfs_version_mount_option} '#{ip}:#{opts[:hostpath]}' '#{opts[:guestpath]}'", {shell: "sh"})
end end
end end
end end