From b86b83eba169b53bbc20f013de30b2f462ab448c Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Wed, 6 Nov 2013 21:21:16 -0200 Subject: [PATCH] Fix WarnNetworks action [GH-154] --- lib/vagrant-lxc/action/warn_networks.rb | 6 +++--- locales/en.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/vagrant-lxc/action/warn_networks.rb b/lib/vagrant-lxc/action/warn_networks.rb index f060080..fed6bd9 100644 --- a/lib/vagrant-lxc/action/warn_networks.rb +++ b/lib/vagrant-lxc/action/warn_networks.rb @@ -7,15 +7,15 @@ module Vagrant end def call(env) - if public_or_private_network_configured? + if public_or_private_network_configured?(env[:machine].config) env[:ui].warn(I18n.t("vagrant_lxc.messages.warn_networks")) end @app.call(env) end - def public_or_private_network_configured? - config.vm.networks.find do |type| + def public_or_private_network_configured?(config) + config.vm.networks.find do |type, _| [:private_network, :public_network].include?(type.to_sym) end end diff --git a/locales/en.yml b/locales/en.yml index 2b6f519..8a24d1d 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -19,7 +19,7 @@ en: Container started and ready for use! warn_networks: |- Warning! The LXC provider doesn't support any of the Vagrant public / private - network configurations (`config.vm.network :private_network, ip: "some-ip"`). + network configurations (ex: `config.vm.network :private_network, ip: "some-ip"`). They will be silently ignored. vagrant: