summaryrefslogtreecommitdiffstats
path: root/src/live/__init__.py
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2023-10-05 16:01:32 +0200
committerJose M. Guisado <jguisado@soleta.eu>2023-10-05 16:19:36 +0200
commit39c13287c53bd81d151116b6af434498cf3da0be (patch)
treeee2900ba1b73c525e625ffcdfc75b2cab2b429e8 /src/live/__init__.py
parent49038f125aaadc3967a8eec251a4ea69ec5a8869 (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 'src/live/__init__.py')
0 files changed, 0 insertions, 0 deletions