Sha256: 8c077ab3042fa3bf8185f03ea985123d13433cece94d7218d15139c12d390910
Contents?: true
Size: 855 Bytes
Versions: 10
Compression:
Stored size: 855 Bytes
Contents
require File.join(File.dirname(__FILE__), 'forward_ports_helpers') 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.logger.info "Deleting any previously set forwarded ports..." 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
10 entries across 10 versions & 2 rubygems