Class: VagrantPlugins::Openstack::Action::ConnectOpenstack

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-openstack-provider/action/connect_openstack.rb

Overview

This action connects to Openstack, verifies credentials work, and puts the Openstack connection object into the :openstack_compute key in the environment.

Instance Method Summary collapse

Constructor Details

#initialize(app, env) ⇒ ConnectOpenstack

Returns a new instance of ConnectOpenstack.



13
14
15
16
# File 'lib/vagrant-openstack-provider/action/connect_openstack.rb', line 13

def initialize(app, env)
  @app = app
  @logger = Log4r::Logger.new("vagrant_openstack::action::connect_openstack")
end

Instance Method Details

#call(env) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/vagrant-openstack-provider/action/connect_openstack.rb', line 18

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