Skip to content

Instantly share code, notes, and snippets.

@elight
Created March 20, 2014 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elight/9665878 to your computer and use it in GitHub Desktop.
Save elight/9665878 to your computer and use it in GitHub Desktop.
private
def authenticate
# puts "===== Fog::Identity::OpenStackCommon -> authenticate ====="
if !@openstack_management_url || @openstack_must_reauthenticate
case @openstack_auth_uri.path
when /v1(\.\d+)?/
Fog::OpenStackCommon::Authenticator.adapter = :authenticator_v1
else
Fog::OpenStackCommon::Authenticator.adapter = :authenticator_v2
end
options = init_auth_options
credentials = Fog::OpenStackCommon::Authenticator.adapter.authenticate(options, @service_options)
handle_auth_results(credentials)
else
@auth_token = @openstack_auth_token
end
save_host_attributes
credentials
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment