Skip to content

Commit

Permalink
Respect the "disabled" flag for shared folders for VirtualBox [GH-1004]
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Mar 21, 2013
1 parent 746c3a1 commit 56d6997
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.3 (unreleased)

Expand Down
9 changes: 9 additions & 0 deletions plugins/providers/virtualbox/action/share_folders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

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
Expand All @@ -27,9 +31,14 @@ def call(env)
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
Expand Down

0 comments on commit 56d6997

Please sign in to comment.