diff options
author | Jose M. Guisado <jguisado@soleta.eu> | 2023-10-05 16:01:32 +0200 |
---|---|---|
committer | Jose M. Guisado <jguisado@soleta.eu> | 2023-10-05 16:19:36 +0200 |
commit | 39c13287c53bd81d151116b6af434498cf3da0be (patch) | |
tree | ee2900ba1b73c525e625ffcdfc75b2cab2b429e8 /tests/units/__init__.py | |
parent | 49038f125aaadc3967a8eec251a4ea69ec5a8869 (diff) |
live: hw_inventory: fix empty memory bank bug
When a client's hardware presents an empty memory bank and invalid call
to _bytes_to_human is performed because None is passed as a parameter.
size = _bytes_to_human(obj.get('size', None))
Fix this by checking if 'size' is present in the JSON output from lshw.
If size is present then map the bytes to a human readable string using
_bytes_to_human, if no size is present then use 'Empty slot' to indicate
that the memory bank is not being used.
Diffstat (limited to 'tests/units/__init__.py')
0 files changed, 0 insertions, 0 deletions