diff options
author | 2015-11-23 16:25:09 +0100 | |
---|---|---|
committer | 2015-11-23 16:25:09 +0100 | |
commit | e09ad6e000cd1b191c4c3ab15b705cfcac24d984 (patch) | |
tree | 1d75085a9f38b44c7287b9ac823bb7a250196828 | |
parent | 59def38972b78682c18b4f1e59d3f81bb64489d0 (diff) |
Fix 2 bugs in Logs (in controller and in DB)
Change-Id: Ifdf9fdbd5956335647d9fb44679f941a699fd7a2
-rw-r--r-- | keystone-moon/keystone/contrib/moon/backends/flat.py | 6 | ||||
-rw-r--r-- | keystone-moon/keystone/contrib/moon/controllers.py | 2 |
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'] |