vagrant/plugins/providers/virtualbox/action/destroy_unused_network_inte...

23 lines
611 B
Ruby
Raw Normal View History

require "log4r"
2012-08-14 06:31:12 +00:00
module VagrantPlugins
module ProviderVirtualBox
module Action
class DestroyUnusedNetworkInterfaces
def initialize(app, env)
@app = app
@logger = Log4r::Logger.new("vagrant::plugins::virtualbox::destroy_unused_netifs")
2012-08-14 06:31:12 +00:00
end
def call(env)
if env[:machine].provider_config.destroy_unused_network_interfaces
@logger.info("Destroying unused network interfaces...")
env[:machine].provider.driver.delete_unused_host_only_networks
@app.call(env)
end
2012-08-14 06:31:12 +00:00
end
end
end
end
end