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:
parent
fd37b8e126
commit
4b3cb2a984
2 changed files with 8 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue