]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix empty ceph version in GET api/hosts 62731/head
authorAfreen Misbah <afreen@ibm.com>
Mon, 7 Apr 2025 19:00:08 +0000 (00:30 +0530)
committerAfreen Misbah <afreen@ibm.com>
Tue, 8 Apr 2025 17:08:22 +0000 (22:38 +0530)
Fixes https://tracker.ceph.com/issues/70821

Due to the pagination the host list is being fetched from orchestrator which caused a regression as via orchestrator list ceph version is always marked empty.
Caused by https://github.com/ceph/ceph/pull/52154

Also fixed tests , as the new version addition causing whole json object mock to fail in tests

Signed-off-by: Afreen Misbah <afreen@ibm.com>
(cherry picked from commit 1aa74cf3fce6394ad08e83e91a90923d983b03c5)

src/pybind/mgr/dashboard/controllers/host.py
src/pybind/mgr/dashboard/tests/test_host.py

index 68dd8440b7f4aa99d9d9d5229b31d503deec560b..ca15df5245c01fa835d5d06badfed81aa5810b3c 100644 (file)
@@ -146,7 +146,7 @@ def get_hosts(sources=None):
             hosts = [
                 merge_dicts(
                     {
-                        'ceph_version': '',
+                        'ceph_version': mgr.version,
                         'services': [],
                         'sources': {
                             'ceph': False,
index 8a86d3b4ba522ca959b83a7bb1c5e62bfe709fcf..99fd6ce3d84b3b7bee171a0d8cd4b6b630ef76ea 100644 (file)
@@ -187,6 +187,7 @@ class HostControllerTest(ControllerTestCase):
 
     def test_get_3(self):
         mgr.list_servers.return_value = []
+        mgr.version = 'ceph version 16.0.0-3151-gf202994fcf'
 
         with patch_orch(True, hosts=[HostSpec('node1')]):
             self._get('{}/node1'.format(self.URL_HOST))
@@ -197,6 +198,7 @@ class HostControllerTest(ControllerTestCase):
 
     def test_populate_service_instances(self):
         mgr.list_servers.return_value = []
+        mgr.version = 'ceph version 16.0.0-3151-gf202994fcf'
 
         node1_daemons = [
             DaemonDescription(