]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume lvm.listing only include devices if they exist 23150/head
authorAlfredo Deza <adeza@redhat.com>
Wed, 18 Jul 2018 20:50:25 +0000 (16:50 -0400)
committerAlfredo Deza <adeza@redhat.com>
Thu, 26 Jul 2018 17:57:41 +0000 (13:57 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
(cherry picked from commit 37565f81634f47c389926d300ed5f92b223bddea)

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

index a84a39c182a512e4a6032e60be0afbf083dd1203..a3975280de72158c26d8f1fed2dc9f309703c42c 100644 (file)
@@ -49,8 +49,15 @@ def pretty_report(report):
                         value=value
                     )
                 )
-            output.append(
-                device_metadata_item_template.format(tag_name='devices', value=','.join(device['devices'])))
+            if not device.get('devices'):
+                continue
+            else:
+                output.append(
+                    device_metadata_item_template.format(
+                        tag_name='devices',
+                        value=','.join(device['devices'])
+                    )
+                )
 
     print(''.join(output))