2013-11-06 22:40:05 +00:00
|
|
|
module Vagrant
|
|
|
|
module LXC
|
|
|
|
module Action
|
|
|
|
class WarnNetworks
|
|
|
|
def initialize(app, env)
|
|
|
|
@app = app
|
|
|
|
end
|
|
|
|
|
|
|
|
def call(env)
|
2014-06-09 03:48:52 +00:00
|
|
|
if public_network_configured?(env[:machine].config)
|
2013-11-06 22:40:05 +00:00
|
|
|
env[:ui].warn(I18n.t("vagrant_lxc.messages.warn_networks"))
|
|
|
|
end
|
|
|
|
|
|
|
|
@app.call(env)
|
|
|
|
end
|
|
|
|
|
2014-06-09 03:48:52 +00:00
|
|
|
def public_network_configured?(config)
|
2013-11-06 23:21:16 +00:00
|
|
|
config.vm.networks.find do |type, _|
|
2014-06-09 03:48:52 +00:00
|
|
|
type.to_sym == :public_network
|
2013-11-06 22:40:05 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|