]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: use api helper methods for pvs and lvs in lvm zap
authorAndrew Schoen <aschoen@redhat.com>
Wed, 7 Feb 2018 15:06:45 +0000 (09:06 -0600)
committerAlfredo Deza <adeza@redhat.com>
Wed, 14 Feb 2018 12:23:03 +0000 (07:23 -0500)
This is just a cleaner way of doing this instead of using PVolumes
and Volumes directly.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
(cherry picked from commit c8a6da4e1bb645ca5ee8cb8f5d861584fe70210d)

src/ceph-volume/ceph_volume/devices/lvm/zap.py

index 0cadc10765edf254cb352e71a107a634ac169b9a..43899e1cd5eefe6e3f531bb60acef9dd23681171 100644 (file)
@@ -62,10 +62,10 @@ class Zap(object):
 
         # check if there was a pv created with the
         # name of device
-        pv = api.PVolumes().get(pv_name=device)
+        pv = api.get_pv(pv_name=device)
         if pv:
             vg_name = pv.vg_name
-            lv = api.Volumes().get(vg_name=vg_name)
+            lv = api.get_lv(vg_name=vg_name)
 
         if lv:
             osd_path = "/var/lib/ceph/osd/{}-{}".format(lv.tags['ceph.cluster_name'], lv.tags['ceph.osd_id'])