Class: VagrantPlugins::QEMU::Action::StopInstance

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-qemu/action/stop_instance.rb

Overview

This stops the running instance.

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ StopInstance



6
7
8
# File 'lib/vagrant-qemu/action/stop_instance.rb', line 6

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

Instance Method Details

#call(env) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/vagrant-qemu/action/stop_instance.rb', line 10

def call(env)
  options = {
    :control_port => env[:machine].provider_config.control_port
  }

  env[:ui].info(I18n.t("vagrant_qemu.stopping"))
  env[:machine].provider.driver.stop(options)
  @app.call(env)
end