2012-08-15 04:12:41 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module ProviderVirtualBox
|
|
|
|
module Action
|
|
|
|
class ClearForwardedPorts
|
|
|
|
def initialize(app, env)
|
|
|
|
@app = app
|
|
|
|
end
|
|
|
|
|
|
|
|
def call(env)
|
2014-02-14 05:04:56 +00:00
|
|
|
if !env[:machine].provider.driver.read_forwarded_ports.empty?
|
|
|
|
env[:ui].info I18n.t("vagrant.actions.vm.clear_forward_ports.deleting")
|
|
|
|
env[:machine].provider.driver.clear_forwarded_ports
|
|
|
|
end
|
2012-08-15 04:12:41 +00:00
|
|
|
|
|
|
|
@app.call(env)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|