diff --git a/CHANGELOG.md b/CHANGELOG.md index dc6ac2a8b..9a3cb7887 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,8 @@ BUG FIXES: - `vagrant ssh-config` IdentityFile is only wrapped in quotes if it contains a space. [GH-1682] - 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) diff --git a/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb b/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb index 656f985e1..cea8e06c4 100644 --- a/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb +++ b/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb @@ -70,7 +70,7 @@ module Vagrant # 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 !repair + if !repair || !options[:auto_correct] raise Errors::ForwardPortCollision, :guest_port => guest_port.to_s, :host_port => host_port.to_s diff --git a/plugins/providers/virtualbox/model/forwarded_port.rb b/plugins/providers/virtualbox/model/forwarded_port.rb index 4ca81f1e2..2229519f7 100644 --- a/plugins/providers/virtualbox/model/forwarded_port.rb +++ b/plugins/providers/virtualbox/model/forwarded_port.rb @@ -50,7 +50,7 @@ module VagrantPlugins @host_port = host_port options ||= {} - @auto_correct = true + @auto_correct = false @auto_correct = options[:auto_correct] if options.has_key?(:auto_correct) @adapter = (options[:adapter] || 1).to_i @guest_ip = options[:guest_ip] || nil