1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[openstack|identity] Added current user id

This commit is contained in:
Alfonso Juan Dillera 2012-03-04 20:29:27 +08:00 committed by Nelvin Driz
parent fd37b8e126
commit 4b3cb2a984
2 changed files with 8 additions and 3 deletions

View file

@ -119,9 +119,12 @@ module Fog
identity_url = identity_svc['endpoints'].detect{|x| x['publicURL']}['publicURL'] if identity_svc
token = body['access']['token']['id']
{ :token => token,
:server_management_url => mgmt_url,
:identity_public_endpoint => identity_url }
{
:token => token,
:server_management_url => mgmt_url,
:identity_public_endpoint => identity_url,
:current_user_id => body['access']['user']['id']
}
end
def self.retrieve_tokens_v2(connection, request_body, uri)

View file

@ -83,6 +83,7 @@ module Fog
def initialize(options={})
require 'multi_json'
attr_reader :openstack_current_user_id
@openstack_auth_token = options[:openstack_auth_token]
@ -173,6 +174,7 @@ module Fog
@openstack_must_reauthenticate = false
@auth_token = credentials[:token]
@openstack_management_url = credentials[:server_management_url]
@openstack_current_user_id = credentials[:current_user_id]
uri = URI.parse(@openstack_management_url)
else
@auth_token = @openstack_auth_token