]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
dashboard: Return float if rate not available 22313/head
authorBoris Ranto <branto@redhat.com>
Tue, 29 May 2018 21:32:48 +0000 (23:32 +0200)
committerBoris Ranto <branto@redhat.com>
Wed, 30 May 2018 06:38:18 +0000 (08:38 +0200)
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 <branto@redhat.com>
src/pybind/mgr/dashboard/services/ceph_service.py

index a2e22f507bbe3dbef0cf02a14da44bbcf0cdd561..174a6ef61c654ac2c3a945a09a8f1aaafb16fcdb 100644 (file)
@@ -176,9 +176,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