From: Boris Ranto Date: Tue, 29 May 2018 21:32:48 +0000 (+0200) Subject: dashboard: Return float if rate not available X-Git-Tag: v13.2.1~127^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5f70635e4e26957bb295a62eb54f2441e8caf207;p=ceph.git dashboard: Return float if rate not available This fixes a test case issue when some of the data might not be available during the test, yet. The test expects the second value to be JFloat but that fails because get_rates return an int in that case. Signed-off-by: Boris Ranto (cherry picked from commit 58ffd146261586b5598c946fd730df0b223294e7) --- diff --git a/src/pybind/mgr/dashboard/services/ceph_service.py b/src/pybind/mgr/dashboard/services/ceph_service.py index 6e91165a3b9..4925f806c94 100644 --- a/src/pybind/mgr/dashboard/services/ceph_service.py +++ b/src/pybind/mgr/dashboard/services/ceph_service.py @@ -167,9 +167,9 @@ class CephService(object): :rtype: list[tuple[int, float]]""" data = mgr.get_counter(svc_type, svc_name, path)[path] if not data: - return [(0, 0)] + return [(0, 0.0)] elif len(data) == 1: - return [(data[0][0], 0)] + return [(data[0][0], 0.0)] return [(data2[0], differentiate(data1, data2)) for data1, data2 in pairwise(data)] @classmethod