Class: VagrantPlugins::SecuredCloud::Action::WarnProvision

Inherits:
Object
  • Object
show all
Defined in:
lib/secured-cloud-vagrant/actions/warn_provision.rb

Overview

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

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ WarnProvision

Returns a new instance of WarnProvision.



11
12
13
14
15
# File 'lib/secured-cloud-vagrant/actions/warn_provision.rb', line 11

def initialize(app, env)
	@app = app
	@machine = env[:machine]
	@logger = Log4r::Logger.new('vagrant::secured_cloud::action::warn_provision')
end

Instance Method Details

#call(env) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/secured-cloud-vagrant/actions/warn_provision.rb', line 17

def call(env)

	@logger.debug("Checking Provision Configurations included in Vagrantfile ...")
	
	if !@machine.config.vm.provisions.nil?
		env[:ui].warn(I18n.t('secured_cloud_vagrant.warnings.provision_support'))
	end
	
	@app.call(env)
end