]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: adds a used_by_ceph property to the Device class
authorAndrew Schoen <aschoen@redhat.com>
Wed, 26 Sep 2018 21:01:30 +0000 (16:01 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Mon, 15 Oct 2018 16:55:49 +0000 (11:55 -0500)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
(cherry picked from commit 9d49a3708e34bccd183d5c32d022c36d8b118b42)

src/ceph-volume/ceph_volume/util/device.py

index 0457d5a1989a3720487b0d5d8cf144b24cf9934a..2eb68d18f18358fa7de9a5b66f8a33610cc560d7 100644 (file)
@@ -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):
     """