Class: OpenStack::Authentication

Inherits:
Object
  • Object
show all
Defined in:
lib/openstack/connection.rb

Overview

OpenStack::Authentication

Class Method Summary collapse

Class Method Details

.init(conn) ⇒ Object

Performs an authentication to the OpenStack auth server. If it succeeds, it sets the service_host, service_path, service_port, service_scheme, authtoken, and authok variables on the connection. If it fails, it raises an exception.



329
330
331
332
333
334
335
336
337
# File 'lib/openstack/connection.rb', line 329

def self.init(conn)
  if conn.auth_path =~ /.*v3\/?$/
    AuthV30.new(conn)
  elsif conn.auth_path =~ /.*v2.0\/?$/
    AuthV20.new(conn)
  else
    AuthV10.new(conn)
  end
end