From e09ad6e000cd1b191c4c3ab15b705cfcac24d984 Mon Sep 17 00:00:00 2001 From: asteroide Date: Mon, 23 Nov 2015 16:25:09 +0100 Subject: Fix 2 bugs in Logs (in controller and in DB) Change-Id: Ifdf9fdbd5956335647d9fb44679f941a699fd7a2 --- keystone-moon/keystone/contrib/moon/backends/flat.py | 6 ++++-- keystone-moon/keystone/contrib/moon/controllers.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'keystone-moon/keystone/contrib') diff --git a/keystone-moon/keystone/contrib/moon/backends/flat.py b/keystone-moon/keystone/contrib/moon/backends/flat.py index 83ed2a08..47c5529a 100644 --- a/keystone-moon/keystone/contrib/moon/backends/flat.py +++ b/keystone-moon/keystone/contrib/moon/backends/flat.py @@ -70,7 +70,8 @@ class LogConnector(LogDriver): if filter_str: _logs = filter(lambda x: filter_str in x, _logs) if time_from: - time_from = time.strptime(time_from.split(" ")[0], self.TIME_FORMAT) + if type(time_from) is basestring: + time_from = time.strptime(time_from.split(" ")[0], self.TIME_FORMAT) try: __logs = [] for log in _logs: @@ -82,7 +83,8 @@ class LogConnector(LogDriver): self.error("Time format error") if time_to: try: - time_to = time.strptime(time_to.split(" ")[0], self.TIME_FORMAT) + if type(time_to) is basestring: + time_to = time.strptime(time_to.split(" ")[0], self.TIME_FORMAT) __logs = [] for log in _logs: _log = time.strptime(log.split(" ")[0], self.TIME_FORMAT) diff --git a/keystone-moon/keystone/contrib/moon/controllers.py b/keystone-moon/keystone/contrib/moon/controllers.py index 84e27fa3..1d9b2725 100644 --- a/keystone-moon/keystone/contrib/moon/controllers.py +++ b/keystone-moon/keystone/contrib/moon/controllers.py @@ -820,7 +820,7 @@ class Logs(controller.V3Controller): def __init__(self): super(Logs, self).__init__() - def _get_user_from_token(self, token_id): + def _get_user_id_from_token(self, token_id): response = self.token_provider_api.validate_token(token_id) token_ref = token_model.KeystoneToken(token_id=token_id, token_data=response) return token_ref['user'] -- cgit 1.2.3-korg