Class: Vagrant::LXC::Action::WarnNetworks
- Inherits:
-
Object
- Object
- Vagrant::LXC::Action::WarnNetworks
- Defined in:
- lib/vagrant-lxc/action/warn_networks.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ WarnNetworks
constructor
A new instance of WarnNetworks.
- #public_network_configured?(config) ⇒ Boolean
Constructor Details
#initialize(app, env) ⇒ WarnNetworks
Returns a new instance of WarnNetworks.
5 6 7 |
# File 'lib/vagrant-lxc/action/warn_networks.rb', line 5 def initialize(app, env) @app = app end |
Instance Method Details
#call(env) ⇒ Object
9 10 11 12 13 14 15 |
# 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) ⇒ Boolean
17 18 19 20 21 |
# 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 |