]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume lvm.listing only include devices if they exist 23129/head
authorAlfredo Deza <adeza@redhat.com>
Wed, 18 Jul 2018 20:50:25 +0000 (16:50 -0400)
committerAlfredo Deza <adeza@redhat.com>
Wed, 18 Jul 2018 20:50:25 +0000 (16:50 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/devices/lvm/listing.py

index 6bc84a16864ee824a16ea4e271fd693f421703ff..96875936377e4e9bd018d861ac3b663310f3f3ee 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))