Don't forward ports if there aren't any to forward

This commit is contained in:
Mitchell Hashimoto 2012-02-07 15:39:54 -08:00
parent 63bd380778
commit a25a691913
4 changed files with 7 additions and 3 deletions

View File

@ -4,6 +4,7 @@
- `vagrant ssh` does a direct `exec()` syscall now instead of going through
the shell. This makes it so things like shell expansion oddities no longer
cause problems. [GH-715]
- Fix crashing case if there are no ports to forward.
## 0.9.5 (February 5, 2012)

View File

@ -81,7 +81,10 @@ module Vagrant
ports << options.merge(:name => options[:name], :adapter => options[:adapter])
end
@env[:vm].driver.forward_ports(ports)
if !ports.empty?
# We only need to forward ports if there are any to forward
@env[:vm].driver.forward_ports(ports)
end
end
end
end

View File

@ -144,7 +144,7 @@ module Vagrant
pf_builder.join(",")])
end
execute("modifyvm", @uuid, *args)
execute("modifyvm", @uuid, *args) if !args.empty?
end
def halt

View File

@ -144,7 +144,7 @@ module Vagrant
pf_builder.join(",")])
end
execute("modifyvm", @uuid, *args)
execute("modifyvm", @uuid, *args) if !args.empty?
end
def halt