fix: TypeError: Object of type Record is not JSON serializable; fix: disk is also virtual if product is None #246

Merged
ypid merged 5 commits from fix/various into master 2022-11-10 15:52:40 +01:00
2 changed files with 3 additions and 2 deletions
Showing only changes of commit bce02a5e7c - Show all commits

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 or product 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 \

View file

@ -63,6 +63,8 @@ def _parse_pd_output(lines):
line = line.strip()
if not line or line.startswith('Note:'):
continue
if 'cache' in line or 'reboot' in line:
continue
# Parses the Array the drives are in
if line.startswith('Array'):
current_array = line.split(None, 1)[1]