Class: VagrantPlugins::Memset::Action::CancelServer

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-memset/action/cancel_server.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ CancelServer

Returns a new instance of CancelServer.



6
7
8
# File 'lib/vagrant-memset/action/cancel_server.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
19
# File 'lib/vagrant-memset/action/cancel_server.rb', line 10

def call(env)

  if env[:machine].id
    server = env[:memset_compute].call("service.cancel",{ :name => "#{env[:machine].id}"})
    env[:ui].info("#{env[:machine].id} has been CANCELLED")
    env[:machine].id = nil
  end

@app.call(env)
end