fix: TypeError: Object of type Record is not JSON serializable; fix: disk is also virtual if product
is None #246
2 changed files with 3 additions and 2 deletions
|
@ -309,14 +309,13 @@ class Inventory():
|
||||||
description = disk.get('description')
|
description = disk.get('description')
|
||||||
size = disk.get('size')
|
size = disk.get('size')
|
||||||
product = disk.get('product')
|
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
|
return True
|
||||||
non_raid_disks = [
|
non_raid_disks = [
|
||||||
'MR9361-8i',
|
'MR9361-8i',
|
||||||
]
|
]
|
||||||
|
|
||||||
if logicalname in raid_devices or \
|
if logicalname in raid_devices or \
|
||||||
disk_type is None or \
|
|
||||||
product in non_raid_disks or \
|
product in non_raid_disks or \
|
||||||
'virtual' in product.lower() or \
|
'virtual' in product.lower() or \
|
||||||
'logical' in product.lower() or \
|
'logical' in product.lower() or \
|
||||||
|
|
|
@ -63,6 +63,8 @@ def _parse_pd_output(lines):
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
if not line or line.startswith('Note:'):
|
if not line or line.startswith('Note:'):
|
||||||
continue
|
continue
|
||||||
|
if 'cache' in line or 'reboot' in line:
|
||||||
|
continue
|
||||||
# Parses the Array the drives are in
|
# Parses the Array the drives are in
|
||||||
if line.startswith('Array'):
|
if line.startswith('Array'):
|
||||||
current_array = line.split(None, 1)[1]
|
current_array = line.split(None, 1)[1]
|
||||||
|
|
Loading…
Reference in a new issue