Class: VagrantPlugins::OpenNebulaProvider::Action::Stop

Inherits:
Object
  • Object
show all
Defined in:
lib/opennebula-provider/action/stop.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ Stop

Returns a new instance of Stop.



5
6
7
8
# File 'lib/opennebula-provider/action/stop.rb', line 5

def initialize(app, env)
  @app = app
  @logger = Log4r::Logger.new('vagrant::provider::opennebula::stop')
end

Instance Method Details

#call(env) ⇒ Object



10
11
12
13
14
15
# File 'lib/opennebula-provider/action/stop.rb', line 10

def call(env)
  env[:ui].info I18n.t('opennebula_provider.info.halt', machine: env[:machine].id)
  driver = env[:machine].provider.driver
  driver.stop(env[:machine].id)
  @app.call(env)
end