From 37565f81634f47c389926d300ed5f92b223bddea Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Wed, 18 Jul 2018 16:50:25 -0400 Subject: [PATCH] ceph-volume lvm.listing only include devices if they exist Signed-off-by: Alfredo Deza --- src/ceph-volume/ceph_volume/devices/lvm/listing.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ceph-volume/ceph_volume/devices/lvm/listing.py b/src/ceph-volume/ceph_volume/devices/lvm/listing.py index 6bc84a16864..96875936377 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))