From 2d43919346abde8784e8a036a818c24838e9863c Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Wed, 2 May 2018 11:31:04 +0200 Subject: [PATCH] mgr/dashboard: fix two type errors found by mypy Signed-off-by: Sebastian Wagner --- src/pybind/mgr/dashboard/controllers/__init__.py | 1 + src/pybind/mgr/dashboard/tests/helper.py | 2 +- src/pybind/mgr/dashboard/tools.py | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pybind/mgr/dashboard/controllers/__init__.py b/src/pybind/mgr/dashboard/controllers/__init__.py index b79b5d0f038..ba49bfb9ba4 100644 --- a/src/pybind/mgr/dashboard/controllers/__init__.py +++ b/src/pybind/mgr/dashboard/controllers/__init__.py @@ -286,6 +286,7 @@ class Task(object): if arg in kwargs: arg_map[arg] = kwargs[arg] if arg in arg_map: + # This is not a type error. We are using the index here. arg_map[idx] = arg_map[arg] return arg_map diff --git a/src/pybind/mgr/dashboard/tests/helper.py b/src/pybind/mgr/dashboard/tests/helper.py index 6eb58a4e835..763f07a04d7 100644 --- a/src/pybind/mgr/dashboard/tests/helper.py +++ b/src/pybind/mgr/dashboard/tests/helper.py @@ -119,7 +119,7 @@ class ControllerTestCase(helper.CPWebCase): self.status = thread.res_task['exception']['status'] else: self.status = 500 - self.body = json.dumps(thread.rest_task['exception']) + self.body = json.dumps(thread.res_task['exception']) return def _task_post(self, url, data=None, timeout=60): diff --git a/src/pybind/mgr/dashboard/tools.py b/src/pybind/mgr/dashboard/tools.py index 05b42d8469a..cdf78efc228 100644 --- a/src/pybind/mgr/dashboard/tools.py +++ b/src/pybind/mgr/dashboard/tools.py @@ -113,8 +113,8 @@ class ViewCache(object): # pylint: disable=broad-except def run(self): - t0 = 0 - t1 = 0 + t0 = 0.0 + t1 = 0.0 try: t0 = time.time() logger.debug("VC: starting execution of %s", self.fn) -- 2.39.5