providers/virtualbox: only clear forwarded ports if there are any

This commit is contained in:
Mitchell Hashimoto 2014-02-13 21:04:56 -08:00
parent 2fe2fe79ed
commit d0cd2464b2
1 changed files with 4 additions and 2 deletions

View File

@ -7,8 +7,10 @@ module VagrantPlugins
end end
def call(env) def call(env)
if !env[:machine].provider.driver.read_forwarded_ports.empty?
env[:ui].info I18n.t("vagrant.actions.vm.clear_forward_ports.deleting") env[:ui].info I18n.t("vagrant.actions.vm.clear_forward_ports.deleting")
env[:machine].provider.driver.clear_forwarded_ports env[:machine].provider.driver.clear_forwarded_ports
end
@app.call(env) @app.call(env)
end end