]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: if using lvm list on a device with many lvs, show them all 20620/head
authorAndrew Schoen <aschoen@redhat.com>
Tue, 27 Feb 2018 15:02:12 +0000 (09:02 -0600)
committerAndrew Schoen <aschoen@redhat.com>
Tue, 27 Feb 2018 15:44:06 +0000 (09:44 -0600)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
src/ceph-volume/ceph_volume/devices/lvm/listing.py

index 6c13526eb11754dc55bae6b7cc9f7d60f2c6cfa2..71407d7ea9a3713c450f4f668f6f5823a26a5cd1 100644 (file)
@@ -6,6 +6,7 @@ from textwrap import dedent
 from ceph_volume import decorators
 from ceph_volume.util import disk
 from ceph_volume.api import lvm as api
+from ceph_volume.exceptions import MultipleLVsError
 
 logger = logging.getLogger(__name__)
 
@@ -129,7 +130,11 @@ class List(object):
         # name of device
         pv = api.get_pv(pv_name=device)
         if pv and not lv:
-            lv = api.get_lv(vg_name=pv.vg_name)
+            try:
+                lv = api.get_lv(vg_name=pv.vg_name)
+            except MultipleLVsError:
+                lvs.filter(vg_name=pv.vg_name)
+                return self.full_report(lvs=lvs)
 
         if lv:
             try:
@@ -165,12 +170,13 @@ class List(object):
                     )
         return report
 
-    def full_report(self):
+    def full_report(self, lvs=None):
         """
         Generate a report for all the logical volumes and associated devices
         that have been previously prepared by Ceph
         """
-        lvs = api.Volumes()
+        if lvs is None:
+            lvs = api.Volumes()
         report = {}
         for lv in lvs:
             try: