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.



9
10
11
# File 'lib/vSphere/action/close_vsphere.rb', line 9

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

Instance Method Details

#call(env) ⇒ Object



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

def call(env)
  env[:vSphere_connection].close if env && env[:vSphere_connection]
  @app.call env
rescue Errors::VSphereError
  raise
rescue StandardError => e
  raise Errors::VSphereError.new, e.message
end