]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix two type errors found by mypy 21774/head
authorSebastian Wagner <sebastian.wagner@suse.com>
Wed, 2 May 2018 09:31:04 +0000 (11:31 +0200)
committerSebastian Wagner <sebastian.wagner@suse.com>
Wed, 2 May 2018 09:31:04 +0000 (11:31 +0200)
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
src/pybind/mgr/dashboard/controllers/__init__.py
src/pybind/mgr/dashboard/tests/helper.py
src/pybind/mgr/dashboard/tools.py

index b79b5d0f03869b875a0a954c0e1f8eaf4991aa7e..ba49bfb9ba4ca9ffde9050bca4030f231ccc8ff8 100644 (file)
@@ -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
index 6eb58a4e835b61ce98873c946d828787c00b601d..763f07a04d7fcb6c5544b5cb0151acc8f170b271 100644 (file)
@@ -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):
index 05b42d8469ac4d3a0d6fea5840310d9ee8f7b25e..cdf78efc22835b623411f5c19f69be906d3dde56 100644 (file)
@@ -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)