class VagrantPlugins::SecuredCloud::Action::WarnNetworks

This can be used with “Call” built-in to check if the machine is created and branch in the middleware.

Public Class Methods

new(app, env) click to toggle source
# File lib/secured-cloud-vagrant/actions/warn_networks.rb, line 11
def initialize(app, env)
        @app = app
        @machine = env[:machine]
        @logger = Log4r::Logger.new('vagrant::secured_cloud::action::warn_networks')
end

Public Instance Methods

call(env) click to toggle source
# File lib/secured-cloud-vagrant/actions/warn_networks.rb, line 17
def call(env)

        @logger.debug("Checking Network Configurations included in Vagrantfile ...")

        if !@machine.config.vm.networks.nil? && @machine.config.vm.networks.length > 1
                env[:ui].warn(I18n.t('secured_cloud_vagrant.warnings.network_support'))
        end
        
        @app.call(env)
end