Sha256: d22312827ee0597543cb6855fdf77ebd87213780c9ca6fa6c870c582ff83bfcc

Contents?: true

Size: 768 Bytes

Versions: 8

Compression:

Stored size: 768 Bytes

Contents

module VagrantPlugins
  module VCenter
    module Action
      # This class disconnects the vagrant-vcenter provider from vCenter.
      class DisconnectvCenter
        def initialize(app, env)
          @app = app
          @logger = Log4r::Logger.new(
                    'vagrant_vcenter::action::disconnect_vcenter')
        end

        def call(env)
          @logger.info('Disconnecting from vCenter ...')

          config = env[:machine].provider_config

          if !config.vcenter_cnx
            @logger.info('Session not open, impossible to disconnect')
          else
            config.vcenter_cnx.close
            @logger.info('Succesfully disconnected from vCenter...')
          end

          @app.call env
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
vagrant-vcenter-0.3.2 lib/vagrant-vcenter/action/disconnect_vcenter.rb
vagrant-vcenter-0.3.1 lib/vagrant-vcenter/action/disconnect_vcenter.rb
vagrant-vcenter-0.3.0 lib/vagrant-vcenter/action/disconnect_vcenter.rb
vagrant-vcenter-0.2.1 lib/vagrant-vcenter/action/disconnect_vcenter.rb
vagrant-vcenter-0.2.0 lib/vagrant-vcenter/action/disconnect_vcenter.rb
vagrant-vcenter-0.1.1 lib/vagrant-vcenter/action/disconnect_vcenter.rb
vagrant-vcenter-0.1.0 lib/vagrant-vcenter/action/disconnect_vcenter.rb
vagrant-vcenter-0.0.2.pre.dev lib/vagrant-vcenter/action/disconnect_vcenter.rb