From: Rishabh Dave Date: Thu, 23 Jan 2020 14:17:21 +0000 (+0530) Subject: ceph-volume: add new method in api/lvm.py X-Git-Tag: v15.1.0~14^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=876244b6ab2cf1fbd724fd33966501a3366c6d3f;p=ceph-ci.git ceph-volume: add new method in api/lvm.py The method determines whether given LV is managed by Ceph or not. Signed-off-by: Rishabh Dave --- diff --git a/src/ceph-volume/ceph_volume/api/lvm.py b/src/ceph-volume/ceph_volume/api/lvm.py index f17a71d7da6..63a48e58a25 100644 --- a/src/ceph-volume/ceph_volume/api/lvm.py +++ b/src/ceph-volume/ceph_volume/api/lvm.py @@ -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