Sha256: 11c6d86344dffdb13d65a54e46a856c49f4d08107bff3dd037e6f4aba59a02b4
Contents?: true
Size: 856 Bytes
Versions: 42
Compression:
Stored size: 856 Bytes
Contents
require File.expand_path("../forward_ports_helpers", __FILE__) module Vagrant class Action module VM class ClearForwardedPorts include ForwardPortsHelpers def initialize(app, env) @app = app @env = env end def call(env) @env = env clear @app.call(env) end def clear if used_ports.length > 0 @env.ui.info I18n.t("vagrant.actions.vm.clear_forward_ports.deleting") clear_ports @env["vm"].reload! end end # Deletes existing forwarded ports. def clear_ports @env["vm"].vm.network_adapters.each do |na| na.nat_driver.forwarded_ports.dup.each do |fp| fp.destroy end end end end end end end
Version data entries
42 entries across 42 versions & 4 rubygems