Class: VagrantPlugins::ProviderBhyve::Action::Shutdown

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-bhyve/action/shutdown.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ Shutdown

Returns a new instance of Shutdown.



8
9
10
11
# File 'lib/vagrant-bhyve/action/shutdown.rb', line 8

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

Instance Method Details

#call(env) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/vagrant-bhyve/action/shutdown.rb', line 13

def call(env)
  @machine 	= env[:machine]
  @ui		= env[:ui]
  @driver	= @machine.provider.driver

  @ui.info I18n.t('vagrant_bhyve.action.vm.halt.shutting_down')
  @driver.shutdown(@ui)
  @app.call(env)
end