class Vagrant::LXC::Action::WarnNetworks

Public Class Methods

new(app, env) click to toggle source
# File lib/vagrant-lxc/action/warn_networks.rb, line 5
def initialize(app, env)
  @app = app
end

Public Instance Methods

call(env) click to toggle source
# File lib/vagrant-lxc/action/warn_networks.rb, line 9
def call(env)
  if public_network_configured?(env[:machine].config)
    env[:ui].warn(I18n.t("vagrant_lxc.messages.warn_networks"))
  end

  @app.call(env)
end
public_network_configured?(config) click to toggle source
# File lib/vagrant-lxc/action/warn_networks.rb, line 17
def public_network_configured?(config)
  config.vm.networks.find do |type, _|
    type.to_sym == :public_network
  end
end