Class: VagrantAWS::Action::Resume

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-aws/action/resume.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ Resume

Returns a new instance of Resume.



4
5
6
# File 'lib/vagrant-aws/action/resume.rb', line 4

def initialize(app, env)
	@app = app
end

Instance Method Details

#call(env) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/vagrant-aws/action/resume.rb', line 8

def call(env)
	if env["vm"].vm.state == "stopped"
		raise VagrantAWS::Errors::EBSDeviceRequired, :command => "resume" if env["vm"].vm.root_device_type != "ebs"
		env.ui.info I18n.t("vagrant.actions.vm.resume.resuming")
		env["vm"].vm.start
	end
	
	@app.call(env)
end