Sha256: 98560feb7dc8772f1cae95802469859061605dfdbdfece089eae879a14f70f06

Contents?: true

Size: 797 Bytes

Versions: 2

Compression:

Stored size: 797 Bytes

Contents

require "log4r"
require "restclient"
require "json"
require_relative "../openstack_client"

module VagrantPlugins
  module Openstack
    module Action
      # This action connects to Openstack, verifies credentials work, and
      # puts the Openstack connection object into the `:openstack_compute` key
      # in the environment.
      class ConnectOpenstack
        def initialize(app, env)
          @app = app
          @logger = Log4r::Logger.new("vagrant_openstack::action::connect_openstack")
        end

        def call(env)
          # Get the configs
          config = env[:machine].provider_config
          client = OpenstackClient::new()
          env[:openstack_client] = client
          client.authenticate(env)
          @app.call(env)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vagrant-openstack-provider-0.1.2 lib/vagrant-openstack-provider/action/connect_openstack.rb
vagrant-openstack-provider-0.1.1 lib/vagrant-openstack/action/connect_openstack.rb