]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/deepsea: use ceph_volume output in get_inventory()
authorTim Serong <tserong@suse.com>
Fri, 15 Mar 2019 04:52:23 +0000 (15:52 +1100)
committerTim Serong <tserong@suse.com>
Tue, 2 Apr 2019 06:14:38 +0000 (17:14 +1100)
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 <tserong@suse.com>
src/pybind/mgr/deepsea/module.py

index 6286942c2f5b340f52d6fdeff423f5e3cafec4e0..2cbf25c14499959d2f30fc4d898d39962ab390e4 100644 (file)
@@ -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'])