Merge pull request #247 from Solvik/fix/cle/inventory-crash-1

fix: disk inventory crash some values are None
This commit is contained in:
Cyril Levis 2022-11-10 15:46:24 +01:00 committed by GitHub
commit 84f1f00ffe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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 \