Do port forwarding threshold check in the `call` method
This commit is contained in:
parent
ca938f041c
commit
72b249fd19
|
@ -4,15 +4,22 @@ module Vagrant
|
||||||
class ForwardPorts
|
class ForwardPorts
|
||||||
def initialize(app,env)
|
def initialize(app,env)
|
||||||
@app = app
|
@app = app
|
||||||
@env = env
|
|
||||||
|
|
||||||
threshold_check
|
|
||||||
end
|
end
|
||||||
|
|
||||||
#--------------------------------------------------------------
|
#--------------------------------------------------------------
|
||||||
# Prepare Helpers - These functions are not involved in actually
|
# Execution
|
||||||
# executing the action
|
|
||||||
#--------------------------------------------------------------
|
#--------------------------------------------------------------
|
||||||
|
def call(env)
|
||||||
|
@env = env
|
||||||
|
|
||||||
|
# Warn if we're port forwarding to any privileged ports...
|
||||||
|
threshold_check
|
||||||
|
|
||||||
|
env[:ui].info I18n.t("vagrant.actions.vm.forward_ports.forwarding")
|
||||||
|
forward_ports(env[:vm])
|
||||||
|
|
||||||
|
@app.call(env)
|
||||||
|
end
|
||||||
|
|
||||||
# This method checks for any forwarded ports on the host below
|
# This method checks for any forwarded ports on the host below
|
||||||
# 1024, which causes the forwarded ports to fail.
|
# 1024, which causes the forwarded ports to fail.
|
||||||
|
@ -25,18 +32,6 @@ module Vagrant
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#--------------------------------------------------------------
|
|
||||||
# Execution
|
|
||||||
#--------------------------------------------------------------
|
|
||||||
def call(env)
|
|
||||||
@env = env
|
|
||||||
|
|
||||||
env[:ui].info I18n.t("vagrant.actions.vm.forward_ports.forwarding")
|
|
||||||
forward_ports(env[:vm])
|
|
||||||
|
|
||||||
@app.call(env)
|
|
||||||
end
|
|
||||||
|
|
||||||
def forward_ports(vm)
|
def forward_ports(vm)
|
||||||
ports = []
|
ports = []
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue