aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuan HE <ruan.he@orange.com>2015-11-23 16:40:22 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2015-11-23 16:40:22 +0000
commitde288802315f804b2c9cfa929980508bb44b8b34 (patch)
treef2ac8c1e86a9820669efd5ae20d6cda9cb944e5a
parent5d85989c9c98aad9c5582195eef0796cd7bb211e (diff)
parente09ad6e000cd1b191c4c3ab15b705cfcac24d984 (diff)
Merge "Fix 2 bugs in Logs (in controller and in DB)"
-rw-r--r--keystone-moon/keystone/contrib/moon/backends/flat.py6
-rw-r--r--keystone-moon/keystone/contrib/moon/controllers.py2
2 files changed, 5 insertions, 3 deletions
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']