Fix WarnNetworks action [GH-154]

This commit is contained in:
Fabio Rehm 2013-11-06 21:21:16 -02:00
parent 0e57cfc2b0
commit b86b83eba1
2 changed files with 4 additions and 4 deletions

View file

@ -7,15 +7,15 @@ module Vagrant
end end
def call(env) 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")) env[:ui].warn(I18n.t("vagrant_lxc.messages.warn_networks"))
end end
@app.call(env) @app.call(env)
end end
def public_or_private_network_configured? def public_or_private_network_configured?(config)
config.vm.networks.find do |type| config.vm.networks.find do |type, _|
[:private_network, :public_network].include?(type.to_sym) [:private_network, :public_network].include?(type.to_sym)
end end
end end

View file

@ -19,7 +19,7 @@ en:
Container started and ready for use! Container started and ready for use!
warn_networks: |- warn_networks: |-
Warning! The LXC provider doesn't support any of the Vagrant public / private 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. They will be silently ignored.
vagrant: vagrant: