NFS folders with spaces should now work [GH-293]

This commit is contained in:
Mitchell Hashimoto 2011-02-08 21:14:20 -08:00
parent cb3084c6e1
commit a0dacb0fc2
5 changed files with 5 additions and 4 deletions

View File

@ -7,6 +7,7 @@
the chef server provisioner. [GH-295]
- Change sudo shell to use `bash` (configurable). [GH-301]
- Can now set mac address of host only network. [GH-294]
- NFS shared folders with spaces now work properly. [GH-293]
## 0.7.1 (January 28, 2011)

View File

@ -25,7 +25,7 @@ module Vagrant
output.split("\n").each do |line|
# This should only ask for administrative permission once, even
# though its executed in multiple subshells.
system(%Q[sudo su root -c "echo '#{line}' >> /etc/exports"])
system(%Q[sudo su root -c "echo '#{line.gsub('"', '\"')}' >> /etc/exports"])
end
# We run restart here instead of "update" just in case nfsd

View File

@ -45,7 +45,7 @@ module Vagrant
folders.each do |name, opts|
vm.ssh.execute do |ssh|
ssh.exec!("sudo mkdir -p #{opts[:guestpath]}")
ssh.exec!("sudo mount #{ip}:#{opts[:hostpath]} #{opts[:guestpath]}", :error_class => LinuxError, :_key => :mount_nfs_fail)
ssh.exec!("sudo mount #{ip}:'#{opts[:hostpath]}' #{opts[:guestpath]}", :error_class => LinuxError, :_key => :mount_nfs_fail)
end
end
end

View File

@ -1,5 +1,5 @@
# VAGRANT-BEGIN: <%= uuid %>
<% folders.each do |name, opts| %>
<%= opts[:hostpath] %> <%= ip %><% if opts[:map_uid] -%> -mapall=<%= [opts[:map_uid],opts[:map_gid]].compact.join(":") %><% end -%>
"<%= opts[:hostpath] %>" <%= ip %><% if opts[:map_uid] -%> -mapall=<%= [opts[:map_uid],opts[:map_gid]].compact.join(":") %><% end -%>
<% end %>
# VAGRANT-END: <%= uuid %>

View File

@ -1,5 +1,5 @@
# VAGRANT-BEGIN: <%= uuid %>
<% folders.each do |name, opts| %>
<%= opts[:hostpath] %> <%= ip %>(rw,no_subtree_check,all_squash<% if opts[:map_uid] %>,anonuid=<%= opts[:map_uid] %><% end %><% if opts[:map_gid] %>,anongid=<%= opts[:map_gid] %><% end %>)
"<%= opts[:hostpath] %>" <%= ip %>(rw,no_subtree_check,all_squash<% if opts[:map_uid] %>,anonuid=<%= opts[:map_uid] %><% end %><% if opts[:map_gid] %>,anongid=<%= opts[:map_gid] %><% end %>)
<% end %>
# VAGRANT-END: <%= uuid %>