summaryrefslogtreecommitdiffstats
path: root/keystone-moon/keystone/token/persistence/backends
diff options
context:
space:
mode:
authorasteroide <thomas.duval@orange.com>2015-09-01 16:03:26 +0200
committerasteroide <thomas.duval@orange.com>2015-09-01 16:04:53 +0200
commit92fd2dbfb672d7b2b1cdfd5dd5cf89f7716b3e12 (patch)
tree7ba22297042019e7363fa1d4ad26d1c32c5908c6 /keystone-moon/keystone/token/persistence/backends
parent26e753254f3e43399cc76e62892908b7742415e8 (diff)
Update Keystone code from official Github repository with branch Master on 09/01/2015.
Change-Id: I0ff6099e6e2580f87f502002a998bbfe12673498
Diffstat (limited to 'keystone-moon/keystone/token/persistence/backends')
-rw-r--r--keystone-moon/keystone/token/persistence/backends/kvs.py13
-rw-r--r--keystone-moon/keystone/token/persistence/backends/sql.py4
2 files changed, 10 insertions, 7 deletions
diff --git a/keystone-moon/keystone/token/persistence/backends/kvs.py b/keystone-moon/keystone/token/persistence/backends/kvs.py
index b4807bf1..1bd08a31 100644
--- a/keystone-moon/keystone/token/persistence/backends/kvs.py
+++ b/keystone-moon/keystone/token/persistence/backends/kvs.py
@@ -22,6 +22,7 @@ from oslo_utils import timeutils
import six
from keystone.common import kvs
+from keystone.common import utils
from keystone import exception
from keystone.i18n import _, _LE, _LW
from keystone import token
@@ -56,10 +57,8 @@ class Token(token.persistence.Driver):
# is instantiated.
LOG.warn(_LW('It is recommended to only use the base '
'key-value-store implementation for the token driver '
- 'for testing purposes. Please use '
- 'keystone.token.persistence.backends.memcache.Token '
- 'or keystone.token.persistence.backends.sql.Token '
- 'instead.'))
+ "for testing purposes. Please use 'memcache' or "
+ "'sql' instead."))
def _prefix_token_id(self, token_id):
return 'token-%s' % token_id.encode('utf-8')
@@ -108,7 +107,7 @@ class Token(token.persistence.Driver):
# concern about the backend, always store the value(s) in the
# index as the isotime (string) version so this is where the string is
# built.
- expires_str = timeutils.isotime(data_copy['expires'], subsecond=True)
+ expires_str = utils.isotime(data_copy['expires'], subsecond=True)
self._set_key(ptk, data_copy)
user_id = data['user']['id']
@@ -207,8 +206,8 @@ class Token(token.persistence.Driver):
'revocation list.'), data['id'])
return
- revoked_token_data['expires'] = timeutils.isotime(expires,
- subsecond=True)
+ revoked_token_data['expires'] = utils.isotime(expires,
+ subsecond=True)
revoked_token_data['id'] = data['id']
token_list = self._get_key_or_default(self.revocation_key, default=[])
diff --git a/keystone-moon/keystone/token/persistence/backends/sql.py b/keystone-moon/keystone/token/persistence/backends/sql.py
index fc70fb92..08c3a216 100644
--- a/keystone-moon/keystone/token/persistence/backends/sql.py
+++ b/keystone-moon/keystone/token/persistence/backends/sql.py
@@ -127,6 +127,7 @@ class Token(token.persistence.Driver):
"""
session = sql.get_session()
+ token_list = []
with session.begin():
now = timeutils.utcnow()
query = session.query(TokenModel)
@@ -148,6 +149,9 @@ class Token(token.persistence.Driver):
continue
token_ref.valid = False
+ token_list.append(token_ref.id)
+
+ return token_list
def _tenant_matches(self, tenant_id, token_ref_dict):
return ((tenant_id is None) or