guests/darwin: respect NFS mount options [GH-3791]
This commit is contained in:
parent
72de106c8f
commit
9c7fb05d5f
|
@ -16,6 +16,7 @@ BUG FIXES:
|
||||||
`docker stop`. [GH-3798]
|
`docker stop`. [GH-3798]
|
||||||
- provisioners/puppet: Fix setting facter vars with Windows
|
- provisioners/puppet: Fix setting facter vars with Windows
|
||||||
guests. [GH-3776]
|
guests. [GH-3776]
|
||||||
|
- guests/darwin: Respect mount options for NFS. [GH-3791]
|
||||||
- guests/freebsd: Properly register the rsync_pre capability
|
- guests/freebsd: Properly register the rsync_pre capability
|
||||||
- guests/windows: Certain executed provisioners won't leave output
|
- guests/windows: Certain executed provisioners won't leave output
|
||||||
and exit status behind. [GH-3729]
|
and exit status behind. [GH-3729]
|
||||||
|
|
|
@ -11,12 +11,24 @@ module VagrantPlugins
|
||||||
expanded_guest_path = machine.guest.capability(
|
expanded_guest_path = machine.guest.capability(
|
||||||
:shell_expand_guest_path, opts[:guestpath])
|
:shell_expand_guest_path, opts[:guestpath])
|
||||||
|
|
||||||
machine.communicate.sudo("if [ ! -d #{expanded_guest_path} ]; then mkdir -p #{expanded_guest_path};fi")
|
# Create the folder
|
||||||
|
machine.communicate.sudo("mkdir -p #{expanded_guest_path}")
|
||||||
|
|
||||||
mount_command = "mount -t nfs '#{ip}:#{opts[:hostpath]}' '#{expanded_guest_path}'"
|
# Figure out any options
|
||||||
retryable(:on => Vagrant::Errors::DarwinNFSMountFailed, :tries => 10, :sleep => 5) do
|
mount_opts = ["vers=#{opts[:nfs_version]}"]
|
||||||
machine.communicate.sudo(mount_command, :error_class => Vagrant::Errors::DarwinNFSMountFailed)
|
mount_opts << "udp" if opts[:nfs_udp]
|
||||||
end
|
if opts[:mount_options]
|
||||||
|
mount_opts = opts[:mount_options].dup
|
||||||
|
end
|
||||||
|
|
||||||
|
mount_command = "mount -t nfs " +
|
||||||
|
"-o '#{mount_opts.join(",")}' " +
|
||||||
|
"'#{ip}:#{opts[:hostpath]}' '#{expanded_guest_path}'"
|
||||||
|
retryable(:on => Vagrant::Errors::DarwinNFSMountFailed, :tries => 10, :sleep => 5) do
|
||||||
|
machine.communicate.sudo(
|
||||||
|
mount_command,
|
||||||
|
error_class: Vagrant::Errors::DarwinNFSMountFailed)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue