From 2b7a1297c85a657291b4373c67edf997d13d2a86 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 29 Aug 2013 12:25:53 -0700 Subject: [PATCH] core: set `disabled: true` for disabling forwarded port [GH-1922] --- CHANGELOG.md | 1 + plugins/providers/virtualbox/util/compile_forwarded_ports.rb | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f458b764..2dd5c6ff3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ IMPROVEMENTS: - core: add `--color` to any Vagrant command to FORCE color output. [GH-2027] - core: "config.vm.host_name" works again, just an alias to hostname. - core: Reboots via SSH are now handled gracefully (without exception). + - core: Mark `disabled` as true on forwarded port to disable. [GH-1922] - commands/plugin/install: Post install message of a plugin will be shown if available. [GH-1986] - commands/status: cosmetic improvement to better align names and diff --git a/plugins/providers/virtualbox/util/compile_forwarded_ports.rb b/plugins/providers/virtualbox/util/compile_forwarded_ports.rb index 7c2bef66f..363722b18 100644 --- a/plugins/providers/virtualbox/util/compile_forwarded_ports.rb +++ b/plugins/providers/virtualbox/util/compile_forwarded_ports.rb @@ -19,6 +19,9 @@ module VagrantPlugins options = scoped_hash_override(options, :virtualbox) id = options[:id] + # If the forwarded port was marked as disabled, ignore. + next if options[:disabled] + mappings[host_port.to_s + protocol.to_s] = Model::ForwardedPort.new(id, host_port, guest_port, options) end