From: Andrew Schoen Date: Wed, 26 Sep 2018 21:01:30 +0000 (-0500) Subject: ceph-volume: adds a used_by_ceph property to the Device class X-Git-Tag: v14.0.1~78^2~20 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9d49a3708e34bccd183d5c32d022c36d8b118b42;p=ceph.git ceph-volume: adds a used_by_ceph property to the Device class Signed-off-by: Andrew Schoen --- diff --git a/src/ceph-volume/ceph_volume/util/device.py b/src/ceph-volume/ceph_volume/util/device.py index 0457d5a1989a..2eb68d18f183 100644 --- a/src/ceph-volume/ceph_volume/util/device.py +++ b/src/ceph-volume/ceph_volume/util/device.py @@ -116,6 +116,11 @@ class Device(object): return self.disk_api['TYPE'] == 'device' return False + @property + def used_by_ceph(self): + osd_ids = [lv.tags.get("ceph.osd_id") for lv in self.lvs] + return any(osd_ids) + class CephDiskDevice(object): """