Merge pull request #688 from schisamo/transient-shared-folder-support

add vbox driver support for creating transient shared folders
This commit is contained in:
Mitchell Hashimoto 2012-01-28 16:50:27 -08:00
commit e9ae63f3b5
4 changed files with 15 additions and 5 deletions

View File

@ -63,7 +63,8 @@ module Vagrant
shared_folders.each do |name, data| shared_folders.each do |name, data|
folders << { folders << {
:name => name, :name => name,
:hostpath => File.expand_path(data[:hostpath], @env[:root_path]) :hostpath => File.expand_path(data[:hostpath], @env[:root_path]),
:transient => data[:transient]
} }
end end

View File

@ -79,6 +79,7 @@ Please change your configurations to match this new syntax.
:owner => nil, :owner => nil,
:group => nil, :group => nil,
:nfs => false, :nfs => false,
:transient => false,
:extra => nil :extra => nil
}.merge(opts || {}) }.merge(opts || {})
end end

View File

@ -392,8 +392,12 @@ module Vagrant
def share_folders(folders) def share_folders(folders)
folders.each do |folder| folders.each do |folder|
execute("sharedfolder", "add", @uuid, "--name", args = ["--name",
folder[:name], "--hostpath", folder[:hostpath]) folder[:name],
"--hostpath",
folder[:hostpath]]
args << "--transient" if folder.has_key?(:transient) && folder[:transient]
execute("sharedfolder", "add", @uuid, *args)
end end
end end

View File

@ -392,8 +392,12 @@ module Vagrant
def share_folders(folders) def share_folders(folders)
folders.each do |folder| folders.each do |folder|
execute("sharedfolder", "add", @uuid, "--name", args = ["--name",
folder[:name], "--hostpath", folder[:hostpath]) folder[:name],
"--hostpath",
folder[:hostpath]]
args << "--transient" if folder.has_key?(:transient) && folder[:transient]
execute("sharedfolder", "add", @uuid, *args)
end end
end end