Class: VagrantPlugins::ProviderLocal::Action::Restart

Inherits:
Object
  • Object
show all
Includes:
Vagrant::Util::Retryable
Defined in:
lib/vagrant-local/action/restart.rb

Overview

This is used to restart the instance

Instance Method Summary collapse

Constructor Details

#initialize(app, _env) ⇒ Restart

Returns a new instance of Restart.



13
14
15
16
# File 'lib/vagrant-local/action/restart.rb', line 13

def initialize(app, _env)
  @logger = Log4r::Logger.new('vagrant_local::action::restart')
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



18
19
20
21
22
23
# File 'lib/vagrant-local/action/restart.rb', line 18

def call(env)
  @machine = env[:machine]
  @driver = @machine.provider.driver
  @driver.control(env[:ui], 'restart')
  @app.call(env)
end