From 0fa7984536be7e08bd478c64ba7f9e53eba0b9eb 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 (cherry picked from commit 37565f81634f47c389926d300ed5f92b223bddea) --- 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 a84a39c182a51..a3975280de721 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)) -- 2.39.5