From b8335b83a01ee39cffd8e4cd80b8c78a628c6584 Mon Sep 17 00:00:00 2001 From: Alfonso Juan Dillera Date: Wed, 18 Jul 2012 13:26:33 +0800 Subject: [PATCH] [openstack|compute] Added auth_token_expiration. --- lib/fog/openstack.rb | 2 ++ lib/fog/openstack/compute.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/fog/openstack.rb b/lib/fog/openstack.rb index f1b7d46c7..902b6879b 100644 --- a/lib/fog/openstack.rb +++ b/lib/fog/openstack.rb @@ -148,11 +148,13 @@ module Fog mgmt_url = svc['endpoints'].detect{|x| x[@endpoint_type]}[@endpoint_type] identity_url = identity_svc['endpoints'].detect{|x| x['publicURL']}['publicURL'] if identity_svc token = body['access']['token']['id'] + expires = body['access']['token']['expires'] { :user => user, :tenant => tenant, :token => token, + :expires => expires, :server_management_url => mgmt_url, :identity_public_endpoint => identity_url, :current_user_id => body['access']['user']['id'] diff --git a/lib/fog/openstack/compute.rb b/lib/fog/openstack/compute.rb index 8aefe93e0..a469e9b4a 100644 --- a/lib/fog/openstack/compute.rb +++ b/lib/fog/openstack/compute.rb @@ -226,6 +226,7 @@ module Fog class Real attr_reader :auth_token + attr_reader :auth_token_expiration attr_reader :current_user attr_reader :current_tenant @@ -338,6 +339,7 @@ module Fog @openstack_must_reauthenticate = false @auth_token = credentials[:token] + @auth_token_expiration = credentials[:expires] @openstack_management_url = credentials[:server_management_url] @openstack_identity_public_endpoint = credentials[:identity_public_endpoint] uri = URI.parse(@openstack_management_url)