Class: VagrantAWS::Action::Suspend
- Inherits:
-
Object
- Object
- VagrantAWS::Action::Suspend
- Defined in:
- lib/vagrant-aws/action/suspend.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ Suspend
constructor
A new instance of Suspend.
Constructor Details
#initialize(app, env) ⇒ Suspend
Returns a new instance of Suspend.
4 5 6 |
# File 'lib/vagrant-aws/action/suspend.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/suspend.rb', line 8 def call(env) if env["vm"].vm.running? raise VagrantAWS::Errors::EBSDeviceRequired, :command => "suspend" if env["vm"].vm.root_device_type != "ebs" env.ui.info I18n.t("vagrant.actions.vm.suspend.suspending") env["vm"].vm.stop end @app.call(env) end |