From: Alfredo Deza Date: Wed, 18 Jul 2018 20:50:25 +0000 (-0400) Subject: ceph-volume lvm.listing only include devices if they exist X-Git-Tag: v14.0.1~838^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=37565f81634f47c389926d300ed5f92b223bddea;p=ceph.git ceph-volume lvm.listing only include devices if they exist Signed-off-by: Alfredo Deza --- diff --git a/src/ceph-volume/ceph_volume/devices/lvm/listing.py b/src/ceph-volume/ceph_volume/devices/lvm/listing.py index 6bc84a16864ee..96875936377e4 100644 --- a/src/ceph-volume/ceph_volume/devices/lvm/listing.py +++ b/src/ceph-volume/ceph_volume/devices/lvm/listing.py @@ -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))