]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
Fix backend testing error due to attribute rename
authorKiefer Chang <kiefer.chang@suse.com>
Tue, 12 Nov 2019 04:47:04 +0000 (12:47 +0800)
committerSebastian Wagner <sebastian@spawnhost.de>
Tue, 12 Nov 2019 08:58:05 +0000 (09:58 +0100)
`id` in Device is renamed to `path`.

Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
src/pybind/mgr/dashboard/controllers/orchestrator.py
src/pybind/mgr/dashboard/tests/test_orchestrator.py

index d2d2e1f9978d0ae6a6f5c481cd247b9691b97531..06011a4037023bd5b09c63aabfde56f3e4d95ed7 100644 (file)
@@ -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
index 8fa191a51dbca29914a6f4acd21ef360fe105303..9e44ea74fdce6a099e55e220f088fba42971c8bf 100644 (file)
@@ -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'},
                 ]
             }
         ]