From 5e537f712656fbc4bfae7a917b4acb205ba8dcaf Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 12 Jul 2010 22:26:01 -0700 Subject: [PATCH] Exports output is in proper format --- lib/vagrant/action/vm/nfs.rb | 7 +++++++ templates/nfs/exports.erb | 2 +- vagrant.gemspec | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/vagrant/action/vm/nfs.rb b/lib/vagrant/action/vm/nfs.rb index 72694ff57..ed31dcc42 100644 --- a/lib/vagrant/action/vm/nfs.rb +++ b/lib/vagrant/action/vm/nfs.rb @@ -38,6 +38,13 @@ module Vagrant # Returns the folders which are to be synced via NFS. def folders @folders ||= {} + @folders.inject({}) do |acc, data| + key, opts = data + opts = opts.dup + opts[:hostpath] = File.expand_path(opts[:hostpath], @env.env.root_path) + acc[key] = opts + acc + end end # Removes the NFS enabled shared folders from the configuration, diff --git a/templates/nfs/exports.erb b/templates/nfs/exports.erb index 2fc418220..026934636 100644 --- a/templates/nfs/exports.erb +++ b/templates/nfs/exports.erb @@ -1,3 +1,3 @@ # VAGRANT-BEGIN: <%= uuid %> -<%= folders.inspect %> +<% folders.each do |name, opts| %><%= opts[:hostpath] %> <%= ip %><% end %> # VAGRANT-END: <%= uuid %> \ No newline at end of file diff --git a/vagrant.gemspec b/vagrant.gemspec index fdcc28cea..c57d41d80 100644 --- a/vagrant.gemspec +++ b/vagrant.gemspec @@ -115,6 +115,7 @@ Gem::Specification.new do |s| "templates/chef_server_client.erb", "templates/chef_solo_solo.erb", "templates/network_entry.erb", + "templates/nfs/exports.erb", "templates/package_Vagrantfile.erb", "templates/ssh_config.erb", "templates/strings.yml", @@ -177,6 +178,7 @@ Gem::Specification.new do |s| "test/vagrant/downloaders/http_test.rb", "test/vagrant/environment_test.rb", "test/vagrant/hosts/base_test.rb", + "test/vagrant/hosts/bsd_test.rb", "test/vagrant/provisioners/base_test.rb", "test/vagrant/provisioners/chef_server_test.rb", "test/vagrant/provisioners/chef_solo_test.rb", @@ -259,6 +261,7 @@ Gem::Specification.new do |s| "test/vagrant/downloaders/http_test.rb", "test/vagrant/environment_test.rb", "test/vagrant/hosts/base_test.rb", + "test/vagrant/hosts/bsd_test.rb", "test/vagrant/provisioners/base_test.rb", "test/vagrant/provisioners/chef_server_test.rb", "test/vagrant/provisioners/chef_solo_test.rb",