lib/vagrant/action/vm/forward_ports.rb in vagrantup-0.6.8 vs lib/vagrant/action/vm/forward_ports.rb in vagrantup-0.6.9
- old
+ new
@@ -21,11 +21,11 @@
# This method checks for any forwarded ports on the host below
# 1024, which causes the forwarded ports to fail.
def threshold_check
@env.env.config.vm.forwarded_ports.each do |name, options|
- raise Errors::ForwardPortBelowThreshold.new if options[:hostport] <= 1024
+ raise Errors::ForwardPortBelowThreshold if options[:hostport] <= 1024
end
end
# This method checks for any port collisions with any VMs
# which are already created (by Vagrant or otherwise).
@@ -45,26 +45,26 @@
# auto fixing is disabled.
def handle_collision(name, options, existing_ports)
if !options[:auto]
# Auto fixing is disabled for this port forward, so we
# must throw an error so the user can fix it.
- raise Errors::ForwardPortCollision.new(:name => name,
- :host_port => options[:hostport].to_s,
- :guest_port => options[:guestport].to_s)
+ raise Errors::ForwardPortCollision, :name => name,
+ :host_port => options[:hostport].to_s,
+ :guest_port => options[:guestport].to_s
end
# Get the auto port range and get rid of the used ports and
# ports which are being used in other forwards so we're just
# left with available ports.
range = @env.env.config.vm.auto_port_range.to_a
range -= @env.env.config.vm.forwarded_ports.collect { |n, o| o[:hostport].to_i }
range -= existing_ports
if range.empty?
- raise Errors::ForwardPortAutolistEmpty.new(:vm_name => @env["vm"].name,
- :name => name,
- :host_port => options[:hostport].to_s,
- :guest_port => options[:guestport].to_s)
+ raise Errors::ForwardPortAutolistEmpty, :vm_name => @env["vm"].name,
+ :name => name,
+ :host_port => options[:hostport].to_s,
+ :guest_port => options[:guestport].to_s
end
# Set the port up to be the first one and add that port to
# the used list.
options[:hostport] = range.shift