fix: crash if product or description None

This commit is contained in:
Cyril Levis 2022-11-10 14:27:17 +01:00
parent 042a6fcf35
commit 8c12fa8e86
No known key found for this signature in database
GPG key ID: 6DB88737C11F5A48

View file

@ -309,14 +309,13 @@ class Inventory():
description = disk.get('description')
size = disk.get('size')
product = disk.get('product')
if logicalname in raid_devices or disk_type is None:
if logicalname in raid_devices or disk_type is None or product is None or description is None:
return True
non_raid_disks = [
'MR9361-8i',
]
if logicalname in raid_devices or \
disk_type is None or \
product in non_raid_disks or \
'virtual' in product.lower() or \
'logical' in product.lower() or \