From 05ac680cb37fd15fdeadaea86780bf1b4f2d566a Mon Sep 17 00:00:00 2001 From: Jan Fajerski Date: Tue, 4 Dec 2018 17:00:59 +0100 Subject: [PATCH] ceph-volume: add partition support to Device Signed-off-by: Jan Fajerski --- src/ceph-volume/ceph_volume/util/device.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ceph-volume/ceph_volume/util/device.py b/src/ceph-volume/ceph_volume/util/device.py index 8507251ee6f38..667bb97f2569c 100644 --- a/src/ceph-volume/ceph_volume/util/device.py +++ b/src/ceph-volume/ceph_volume/util/device.py @@ -110,6 +110,14 @@ class Device(object): if not sys_info.devices: sys_info.devices = disk.get_devices() self.sys_api = sys_info.devices.get(self.abspath, {}) + if not self.sys_api: + # if no device was found check if we are a partition + partname = self.abspath.split('/')[-1] + for device, info in sys_info.devices.items(): + part = info['partitions'].get(partname, {}) + if part: + self.sys_api = part + break # start with lvm since it can use an absolute or relative path lv = lvm.get_lv_from_argument(self.path) -- 2.39.5