core: set `disabled: true` for disabling forwarded port [GH-1922]

This commit is contained in:
Mitchell Hashimoto 2013-08-29 12:25:53 -07:00
parent c2012ff944
commit 2b7a1297c8
2 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,7 @@ IMPROVEMENTS:
- core: add `--color` to any Vagrant command to FORCE color output. [GH-2027] - 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: "config.vm.host_name" works again, just an alias to hostname.
- core: Reboots via SSH are now handled gracefully (without exception). - 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 - commands/plugin/install: Post install message of a plugin will be
shown if available. [GH-1986] shown if available. [GH-1986]
- commands/status: cosmetic improvement to better align names and - commands/status: cosmetic improvement to better align names and

View File

@ -19,6 +19,9 @@ module VagrantPlugins
options = scoped_hash_override(options, :virtualbox) options = scoped_hash_override(options, :virtualbox)
id = options[:id] id = options[:id]
# If the forwarded port was marked as disabled, ignore.
next if options[:disabled]
mappings[host_port.to_s + protocol.to_s] = mappings[host_port.to_s + protocol.to_s] =
Model::ForwardedPort.new(id, host_port, guest_port, options) Model::ForwardedPort.new(id, host_port, guest_port, options)
end end