Respect the "disabled" flag for shared folders for VirtualBox [GH-1004]

This commit is contained in:
Mitchell Hashimoto 2013-03-17 15:31:57 -07:00
parent 87f7cba16b
commit 79ba9df881
2 changed files with 12 additions and 0 deletions

View File

@ -1,6 +1,9 @@
## 1.2.0 (unreleased)
IMPROVEMENTS:
- By adding the "disabled" boolean flag to synced folders you can disable
them altogether. [GH-1004]
## 1.1.6 (April 3, 2013)

View File

@ -2,10 +2,14 @@ require "pathname"
require "log4r"
require "vagrant/util/scoped_hash_override"
module VagrantPlugins
module ProviderVirtualBox
module Action
class ShareFolders
include Vagrant::Util::ScopedHashOverride
def initialize(app, env)
@logger = Log4r::Logger.new("vagrant::action::vm::share_folders")
@app = app
@ -27,9 +31,14 @@ module VagrantPlugins
def shared_folders
{}.tap do |result|
@env[:machine].config.vm.synced_folders.each do |id, data|
data = scoped_hash_override(data, :virtualbox)
# Ignore NFS shared folders
next if data[:nfs]
# Ignore disabled shared folders
next if data[:disabled]
# This to prevent overwriting the actual shared folders data
result[id] = data.dup
end