# File lib/fog/identity/openstack.rb, line 54 def initialize(options = {}) if options.respond_to?(:config_service?) && options.config_service? configure(options) return end initialize_identity(options) @openstack_service_type = options[:openstack_service_type] || default_service_type(options) @openstack_service_name = options[:openstack_service_name] @connection_options = options[:connection_options] || {} @openstack_endpoint_type = options[:openstack_endpoint_type] || 'adminURL' initialize_endpoint_path_matches(options) authenticate if options[:openstack_identity_prefix] @path = "/#{options[:openstack_identity_prefix]}/#{@path}" end @persistent = options[:persistent] || false @connection = Fog::Core::Connection.new("#{@scheme}://#{@host}:#{@port}", @persistent, @connection_options) end
# File lib/fog/identity/openstack.rb, line 50 def self.not_found_class Fog::Identity::OpenStack::NotFound end
# File lib/fog/identity/openstack.rb, line 84 def config self end
# File lib/fog/identity/openstack.rb, line 80 def config_service? true end
# File lib/fog/identity/openstack.rb, line 106 def configure(source) source.instance_variables.each do |v| instance_variable_set(v, source.instance_variable_get(v)) end end
# File lib/fog/identity/openstack.rb, line 90 def default_service_type(options) unless options[:openstack_identity_prefix] if @openstack_auth_uri.path =~ %r{/v3} || (options[:openstack_endpoint_path_matches] && options[:openstack_endpoint_path_matches] =~ '/v3') return DEFAULT_SERVICE_TYPE_V3 end end DEFAULT_SERVICE_TYPE end
# File lib/fog/identity/openstack.rb, line 100 def initialize_endpoint_path_matches(options) if options[:openstack_endpoint_path_matches] @openstack_endpoint_path_matches = options[:openstack_endpoint_path_matches] end end