Class: VagrantPlugins::Utm::Action::ClearForwardedPorts
- Inherits:
-
Object
- Object
- VagrantPlugins::Utm::Action::ClearForwardedPorts
- Defined in:
- lib/vagrant_utm/action/clear_forwarded_ports.rb
Overview
This action clears forwarded ports on the UTM VM.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, _env) ⇒ ClearForwardedPorts
constructor
A new instance of ClearForwardedPorts.
Constructor Details
#initialize(app, _env) ⇒ ClearForwardedPorts
Returns a new instance of ClearForwardedPorts.
11 12 13 |
# File 'lib/vagrant_utm/action/clear_forwarded_ports.rb', line 11 def initialize(app, _env) @app = app end |
Instance Method Details
#call(env) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/vagrant_utm/action/clear_forwarded_ports.rb', line 15 def call(env) unless 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 @app.call(env) end |