2013-07-23 20:13:11 +00:00
|
|
|
require "log4r"
|
|
|
|
|
2012-08-14 06:31:12 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module ProviderVirtualBox
|
|
|
|
module Action
|
|
|
|
class DestroyUnusedNetworkInterfaces
|
|
|
|
def initialize(app, env)
|
|
|
|
@app = app
|
2013-07-23 20:13:11 +00:00
|
|
|
@logger = Log4r::Logger.new("vagrant::plugins::virtualbox::destroy_unused_netifs")
|
2012-08-14 06:31:12 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def call(env)
|
2013-07-23 20:13:11 +00:00
|
|
|
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
|