use lshw for inventory #58
2 changed files with 13 additions and 16 deletions
|
@ -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 = []
|
||||
|
||||
|
|
|
@ -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"]
|
||||
|
|
Loading…
Add table
Reference in a new issue