Respect the "disabled" flag for shared folders for VirtualBox [GH-1004]
This commit is contained in:
parent
87f7cba16b
commit
79ba9df881
|
@ -1,6 +1,9 @@
|
||||||
## 1.2.0 (unreleased)
|
## 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)
|
## 1.1.6 (April 3, 2013)
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,14 @@ require "pathname"
|
||||||
|
|
||||||
require "log4r"
|
require "log4r"
|
||||||
|
|
||||||
|
require "vagrant/util/scoped_hash_override"
|
||||||
|
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module ProviderVirtualBox
|
module ProviderVirtualBox
|
||||||
module Action
|
module Action
|
||||||
class ShareFolders
|
class ShareFolders
|
||||||
|
include Vagrant::Util::ScopedHashOverride
|
||||||
|
|
||||||
def initialize(app, env)
|
def initialize(app, env)
|
||||||
@logger = Log4r::Logger.new("vagrant::action::vm::share_folders")
|
@logger = Log4r::Logger.new("vagrant::action::vm::share_folders")
|
||||||
@app = app
|
@app = app
|
||||||
|
@ -27,9 +31,14 @@ module VagrantPlugins
|
||||||
def shared_folders
|
def shared_folders
|
||||||
{}.tap do |result|
|
{}.tap do |result|
|
||||||
@env[:machine].config.vm.synced_folders.each do |id, data|
|
@env[:machine].config.vm.synced_folders.each do |id, data|
|
||||||
|
data = scoped_hash_override(data, :virtualbox)
|
||||||
|
|
||||||
# Ignore NFS shared folders
|
# Ignore NFS shared folders
|
||||||
next if data[:nfs]
|
next if data[:nfs]
|
||||||
|
|
||||||
|
# Ignore disabled shared folders
|
||||||
|
next if data[:disabled]
|
||||||
|
|
||||||
# This to prevent overwriting the actual shared folders data
|
# This to prevent overwriting the actual shared folders data
|
||||||
result[id] = data.dup
|
result[id] = data.dup
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue