From b0f9c4b5101f92b9e68a6512a9c05bfd345baf2d Mon Sep 17 00:00:00 2001 From: Tim Serong Date: Fri, 15 Mar 2019 15:52:23 +1100 Subject: [PATCH] mgr/deepsea: use ceph_volume output in get_inventory() DeepSea is being updated to use ceph_volume internally (see https://github.com/SUSE/DeepSea/pull/1517). Once this is done, the mgr_orch.get_inventory runner will just be returning the raw ceph_volume output, so this commit updates the DeepSea mgr module to match. Signed-off-by: Tim Serong --- src/pybind/mgr/deepsea/module.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/pybind/mgr/deepsea/module.py b/src/pybind/mgr/deepsea/module.py index 6286942c2f5..2cbf25c1449 100644 --- a/src/pybind/mgr/deepsea/module.py +++ b/src/pybind/mgr/deepsea/module.py @@ -133,16 +133,9 @@ class DeepSeaOrchestrator(MgrModule, orchestrator.Orchestrator): result = [] if event_data['success']: for node_name, node_devs in event_data["return"].items(): - devs = [] - for d in node_devs: - dev = orchestrator.InventoryDevice() - dev.blank = d['blank'] - dev.type = d['type'] - dev.id = d['id'] - dev.size = d['size'] - dev.extended = d['extended'] - dev.metadata_space_free = d['metadata_space_free'] - devs.append(dev) + devs = list(map(lambda di: + orchestrator.InventoryDevice.from_ceph_volume_inventory(di), + node_devs)) result.append(orchestrator.InventoryNode(node_name, devs)) else: self.log.error(event_data['return']) -- 2.39.5