From: Kiefer Chang Date: Tue, 12 Nov 2019 04:47:04 +0000 (+0800) Subject: Fix backend testing error due to attribute rename X-Git-Tag: v15.1.0~921^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=87459b196820d263781bda383700e66e21a28ea6;p=ceph-ci.git Fix backend testing error due to attribute rename `id` in Device is renamed to `path`. Signed-off-by: Kiefer Chang --- diff --git a/src/pybind/mgr/dashboard/controllers/orchestrator.py b/src/pybind/mgr/dashboard/controllers/orchestrator.py index d2d2e1f9978..06011a40370 100644 --- a/src/pybind/mgr/dashboard/controllers/orchestrator.py +++ b/src/pybind/mgr/dashboard/controllers/orchestrator.py @@ -81,7 +81,7 @@ class OrchestratorInventory(RESTController): node_osds = device_osd_map.get(inventory_node['name']) for device in inventory_node['devices']: if node_osds: - device['osd_ids'] = sorted(node_osds.get(device['id'], [])) + device['osd_ids'] = sorted(node_osds.get(device['path'], [])) else: device['osd_ids'] = [] return inventory_nodes diff --git a/src/pybind/mgr/dashboard/tests/test_orchestrator.py b/src/pybind/mgr/dashboard/tests/test_orchestrator.py index 8fa191a51db..9e44ea74fdc 100644 --- a/src/pybind/mgr/dashboard/tests/test_orchestrator.py +++ b/src/pybind/mgr/dashboard/tests/test_orchestrator.py @@ -4,8 +4,6 @@ try: except ImportError: from unittest import mock -from ceph.deployment.inventory import Devices - from orchestrator import InventoryNode, ServiceDescription from . import ControllerTestCase @@ -68,16 +66,16 @@ class OrchestratorControllerTest(ControllerTestCase): { 'name': 'host-0', 'devices': [ - {'id': 'nvme0n1'}, - {'id': 'sdb'}, - {'id': 'sdc'}, + {'path': 'nvme0n1'}, + {'path': 'sdb'}, + {'path': 'sdc'}, ] }, { 'name': 'host-1', 'devices': [ - {'id': 'sda'}, - {'id': 'sdb'}, + {'path': 'sda'}, + {'path': 'sdb'}, ] } ]