use lshw for inventory #58

Merged
ThomasADavis merged 15 commits from lshw-inventory into master 2019-09-05 15:13:37 +02:00
2 changed files with 13 additions and 16 deletions
Showing only changes of commit 88387a595c - Show all commits

View file

@ -86,7 +86,7 @@ class Inventory():
device_id=device_id,
tag=tag
)
except:
except BaseException:
logging.info('Tag {tag} is missing, returning empty array.'.format(tag=tag))
items = []

View file

@ -1,5 +1,4 @@
import subprocess
import getpass
import json
@ -8,8 +7,7 @@ class LSHW():
self.hw_info = json.loads(
subprocess.check_output(["lshw", "-quiet", "-json"],
encoding='utf8')
)
encoding='utf8')) # noqa: E128
self.info = {}
self.memories = []
@ -82,8 +80,7 @@ class LSHW():
elif "nvme" in obj["configuration"]["driver"]:
nvme = json.loads(
subprocess.check_output(["nvme", '-list', '-o', 'json'],
encoding='utf8')
)
encoding='utf8')) # noqa: E128
d = {}
d["vendor"] = obj["vendor"]