Class: VagrantPlugins::OVirtProvider::Action::SuspendVM

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-ovirt4/action/suspend_vm.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ SuspendVM

Returns a new instance of SuspendVM.



7
8
9
10
# File 'lib/vagrant-ovirt4/action/suspend_vm.rb', line 7

def initialize(app, env)
  @logger = Log4r::Logger.new("vagrant_ovirt4::action::suspend_vm")
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/vagrant-ovirt4/action/suspend_vm.rb', line 12

def call(env)
  env[:ui].info(I18n.t("vagrant_ovirt4.suspend_vm"))

  machine = env[:vms_service].vm_service(env[:machine].id)
  machine.suspend

  @app.call(env)
end