Class: VagrantPlugins::Parallels::Action::DestroyUnusedNetworkInterfaces

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-parallels/action/destroy_unused_network_interfaces.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ DestroyUnusedNetworkInterfaces

Returns a new instance of DestroyUnusedNetworkInterfaces.



7
8
9
# File 'lib/vagrant-parallels/action/destroy_unused_network_interfaces.rb', line 7

def initialize(app, env)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/vagrant-parallels/action/destroy_unused_network_interfaces.rb', line 11

def call(env)
  if env[:machine].provider_config.destroy_unused_network_interfaces
    env[:ui].info I18n.t('vagrant.actions.vm.destroy_network.destroying')
    env[:machine].provider.driver.delete_unused_host_only_networks
  end

  @app.call(env)
end