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)
  @logger.info I18n.t('opennebula_provider.info.stop', machine: env[:machine].id)
  env[:rocci].stop(env[:machine].id)
  env[:rocci].wait_for_state(env, 'suspended')
  @app.call(env)
end