]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
ceph-volume: add new method in api/lvm.py
authorRishabh Dave <ridave@redhat.com>
Thu, 23 Jan 2020 14:17:21 +0000 (19:47 +0530)
committerRishabh Dave <ridave@redhat.com>
Tue, 28 Jan 2020 15:25:57 +0000 (20:55 +0530)
The method determines whether given LV is managed by Ceph or not.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
src/ceph-volume/ceph_volume/api/lvm.py

index f17a71d7da63f21e81eeeb3899e90c8140ac054d..63a48e58a2544ff58e7c4be0b90899ed4ea20c12 100644 (file)
@@ -267,6 +267,16 @@ def dmsetup_splitname(dev):
     return _splitname_parser(out)
 
 
+def is_ceph_device(lv):
+    try:
+        lv.tags['ceph.osd_id']
+    except (KeyError, AttributeError):
+        logger.warning('device is not part of ceph: %s', lv)
+        return False
+
+    return True
+
+
 ####################################
 #
 # Code for LVM Physical Volumes