Sha256: 1feff42bd0a0397f6c9b87a0d73aa7e44ffc52c368c35ffc3a5b12ea3142c5f9

Contents?: true

Size: 538 Bytes

Versions: 13

Compression:

Stored size: 538 Bytes

Contents

module Vagrant
  module LXC
    module Action
      class WarnNetworks
        def initialize(app, env)
          @app = app
        end

        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

        def public_network_configured?(config)
          config.vm.networks.find do |type, _|
            type.to_sym == :public_network
          end
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
vagrant-lxc-1.4.3 lib/vagrant-lxc/action/warn_networks.rb
vagrant-lxc-1.4.2 lib/vagrant-lxc/action/warn_networks.rb
vagrant-lxc-1.4.1 lib/vagrant-lxc/action/warn_networks.rb
vagrant-lxc-2.1-patch-1.4.0 lib/vagrant-lxc/action/warn_networks.rb
vagrant-lxc-1.4.0 lib/vagrant-lxc/action/warn_networks.rb
vagrant-lxc-1.3.1 lib/vagrant-lxc/action/warn_networks.rb
vagrant-lxc-1.3.0 lib/vagrant-lxc/action/warn_networks.rb
vagrant-lxc-1.2.4 lib/vagrant-lxc/action/warn_networks.rb
vagrant-lxc-1.2.3 lib/vagrant-lxc/action/warn_networks.rb
vagrant-lxc-1.2.2 lib/vagrant-lxc/action/warn_networks.rb
vagrant-lxc-1.2.1 lib/vagrant-lxc/action/warn_networks.rb
vagrant-lxc-1.2.0 lib/vagrant-lxc/action/warn_networks.rb
vagrant-lxc-1.1.0 lib/vagrant-lxc/action/warn_networks.rb