Forwarded ports don't auto-correct by default [GH-1701]

This commit is contained in:
Mitchell Hashimoto 2013-07-20 00:15:11 -04:00
parent eb70c0d6bb
commit 4151df884a
3 changed files with 4 additions and 2 deletions

View File

@ -40,6 +40,8 @@ BUG FIXES:
- `vagrant ssh-config` IdentityFile is only wrapped in quotes if it - `vagrant ssh-config` IdentityFile is only wrapped in quotes if it
contains a space. [GH-1682] contains a space. [GH-1682]
- Shared folder target path can be a Windows path. [GH-1688] - Shared folder target path can be a Windows path. [GH-1688]
- Forwarded ports don't auto-correct by default, and will raise an
error properly if they collide. [GH-1701]
## 1.2.4 (July 16, 2013) ## 1.2.4 (July 16, 2013)

View File

@ -70,7 +70,7 @@ module Vagrant
# If the port is open (listening for TCP connections) # If the port is open (listening for TCP connections)
if extra_in_use.include?(host_port) || is_port_open?("127.0.0.1", host_port) if extra_in_use.include?(host_port) || is_port_open?("127.0.0.1", host_port)
if !repair if !repair || !options[:auto_correct]
raise Errors::ForwardPortCollision, raise Errors::ForwardPortCollision,
:guest_port => guest_port.to_s, :guest_port => guest_port.to_s,
:host_port => host_port.to_s :host_port => host_port.to_s

View File

@ -50,7 +50,7 @@ module VagrantPlugins
@host_port = host_port @host_port = host_port
options ||= {} options ||= {}
@auto_correct = true @auto_correct = false
@auto_correct = options[:auto_correct] if options.has_key?(:auto_correct) @auto_correct = options[:auto_correct] if options.has_key?(:auto_correct)
@adapter = (options[:adapter] || 1).to_i @adapter = (options[:adapter] || 1).to_i
@guest_ip = options[:guest_ip] || nil @guest_ip = options[:guest_ip] || nil