diff options
author | Jose M. Guisado <jguisado@soleta.eu> | 2023-07-21 09:49:24 +0200 |
---|---|---|
committer | Jose M. Guisado <jguisado@soleta.eu> | 2023-07-21 11:55:25 +0200 |
commit | ee0d62db444441be41d99ac4ee5f2de5100cd934 (patch) | |
tree | 72a226395568a1a7b8a09bf5e005797e59fac849 /src/linux | |
parent | 035995fc8c55740693575ca5f7b408bfc46c1f7d (diff) |
hw_inventory: use dict.get
The first stage of parsing the "lshw -json" command output is to load
the json string into a Python dictionary. lshw output is large and
varies from machine to machine, so it's not safe to assume that
different keys will be present in the dictionary.
Use dict.get() instead of dict[key] to avoid KeyError exceptions.
Diffstat (limited to 'src/linux')
0 files changed, 0 insertions, 0 deletions