Add `fsid` to linux exports for NFS. [GH-736]

This commit is contained in:
Mitchell Hashimoto 2012-02-14 23:08:32 -08:00
parent 96a920e4e5
commit 034477b52a
4 changed files with 10 additions and 2 deletions

View File

@ -20,6 +20,7 @@
- Fix issue where Vagrant would sometimes "lose" a VM if an exception
occurred. [GH-725]
- `vagrant destroy` destroys virtual machines in reverse order. [GH-739]
- Add an `fsid` option to Linux NFS exports. [GH-736]
## 0.9.7 (February 9, 2012)

View File

@ -1,3 +1,4 @@
require 'digest/md5'
require 'fileutils'
require 'pathname'
@ -93,6 +94,12 @@ module Vagrant
opts[:map_gid] = prepare_permission(:gid, opts)
opts[:nfs_version] ||= 3
# The poor man's UUID. An MD5 hash here is sufficient since
# we need a 32 character "uuid" to represent the filesystem
# of an export. Hashing the host path is safe because two of
# the same host path will hash to the same fsid.
opts[:uuid] = Digest::MD5.hexdigest(opts[:hostpath])
acc[key] = opts
acc
end

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 %>,fsid=<%= opts[:uuid] %>)
<% end %>
# VAGRANT-END: <%= uuid %>

View File

@ -17,11 +17,11 @@ Gem::Specification.new do |s|
s.add_dependency "archive-tar-minitar", "= 0.5.2"
s.add_dependency "childprocess", "~> 0.3.1"
s.add_dependency "erubis", "~> 2.7.0"
s.add_dependency "i18n", "~> 0.6.0"
s.add_dependency "json", "~> 1.5.1"
s.add_dependency "log4r", "~> 1.1.9"
s.add_dependency "net-ssh", "~> 2.2.2"
s.add_dependency "net-scp", "~> 1.0.4"
s.add_dependency "i18n", "~> 0.6.0"
s.add_development_dependency "rake"
s.add_development_dependency "contest", ">= 0.1.2"