Class: VagrantPlugins::VSphere::Action::CloseVSphere

Inherits:
Object
  • Object
show all
Defined in:
lib/vSphere/action/close_vsphere.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ CloseVSphere

Returns a new instance of CloseVSphere.



7
8
9
# File 'lib/vSphere/action/close_vsphere.rb', line 7

def initialize(app, env)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/vSphere/action/close_vsphere.rb', line 11

def call(env)
  begin
    env[:vSphere_connection].close
    @app.call env
  rescue Exception => e
    puts e
    #raise a properly namespaced error for Vagrant
    raise Errors::VSphereError, :message => e.message
  end
end