Compare commits

..

No commits in common. "bed40d3ee039418eb5dea0e16878464d270669f1" and "a0276f439e560bad3a5b7a66c7a3b8fbf9ab1a56" have entirely different histories.

2 changed files with 13 additions and 13 deletions

View File

@ -83,7 +83,7 @@ class Build:
def get_hid(self, snapshot): def get_hid(self, snapshot):
try: try:
self.inxi = json.loads(self.json["data"]["inxi"]) self.inxi = json.loads(self.json["inxi"])
except Exception: except Exception:
logger.error("No inxi in snapshot %s", self.uuid) logger.error("No inxi in snapshot %s", self.uuid)
return "" return ""

View File

@ -54,7 +54,7 @@ class ParseSnapshot:
} }
def set_computer(self): def set_computer(self):
machine = get_inxi_key(self.inxi, 'Machine') or [] machine = get_inxi_key(self.inxi, 'Machine')
for m in machine: for m in machine:
system = get_inxi(m, "System") system = get_inxi(m, "System")
if system: if system:
@ -80,7 +80,7 @@ class ParseSnapshot:
self.get_battery() self.get_battery()
def get_mother_board(self): def get_mother_board(self):
machine = get_inxi_key(self.inxi, 'Machine') or [] machine = get_inxi_key(self.inxi, 'Machine')
mb = {"type": "Motherboard",} mb = {"type": "Motherboard",}
for m in machine: for m in machine:
bios_date = get_inxi(m, "date") bios_date = get_inxi(m, "date")
@ -102,7 +102,7 @@ class ParseSnapshot:
self.components.append(mb) self.components.append(mb)
def get_ram_slots(self, mb): def get_ram_slots(self, mb):
memory = get_inxi_key(self.inxi, 'Memory') or [] memory = get_inxi_key(self.inxi, 'Memory')
for m in memory: for m in memory:
slots = get_inxi(m, "slots") slots = get_inxi(m, "slots")
if not slots: if not slots:
@ -113,7 +113,7 @@ class ParseSnapshot:
def get_cpu(self): def get_cpu(self):
cpu = get_inxi_key(self.inxi, 'CPU') or [] cpu = get_inxi_key(self.inxi, 'CPU')
cp = {"type": "Processor"} cp = {"type": "Processor"}
vulnerabilities = [] vulnerabilities = []
for c in cpu: for c in cpu:
@ -158,7 +158,7 @@ class ParseSnapshot:
def get_ram(self): def get_ram(self):
memory = get_inxi_key(self.inxi, 'Memory') or [] memory = get_inxi_key(self.inxi, 'Memory')
mem = {"type": "RamModule"} mem = {"type": "RamModule"}
for m in memory: for m in memory:
@ -180,7 +180,7 @@ class ParseSnapshot:
self.components.append(mem) self.components.append(mem)
def get_graphic(self): def get_graphic(self):
graphics = get_inxi_key(self.inxi, 'Graphics') or [] graphics = get_inxi_key(self.inxi, 'Graphics')
for c in graphics: for c in graphics:
if not get_inxi(c, "Device") or not get_inxi(c, "vendor"): if not get_inxi(c, "Device") or not get_inxi(c, "vendor"):
@ -199,7 +199,7 @@ class ParseSnapshot:
) )
def get_battery(self): def get_battery(self):
bats = get_inxi_key(self.inxi, 'Battery') or [] bats = get_inxi_key(self.inxi, 'Battery')
for b in bats: for b in bats:
self.components.append( self.components.append(
{ {
@ -213,7 +213,7 @@ class ParseSnapshot:
) )
def get_memory_video(self, c): def get_memory_video(self, c):
memory = get_inxi_key(self.inxi, 'Memory') or [] memory = get_inxi_key(self.inxi, 'Memory')
for m in memory: for m in memory:
igpu = get_inxi(m, "igpu") igpu = get_inxi(m, "igpu")
@ -226,7 +226,7 @@ class ParseSnapshot:
return self.default return self.default
def get_data_storage(self): def get_data_storage(self):
hdds= get_inxi_key(self.inxi, 'Drives') or [] hdds= get_inxi_key(self.inxi, 'Drives')
for d in hdds: for d in hdds:
usb = get_inxi(d, "type") usb = get_inxi(d, "type")
if usb == "USB": if usb == "USB":
@ -277,7 +277,7 @@ class ParseSnapshot:
return [] return []
def get_networks(self): def get_networks(self):
nets = get_inxi_key(self.inxi, "Network") or [] nets = get_inxi_key(self.inxi, "Network")
networks = [(nets[i], nets[i + 1]) for i in range(0, len(nets) - 1, 2)] networks = [(nets[i], nets[i + 1]) for i in range(0, len(nets) - 1, 2)]
for n, iface in networks: for n, iface in networks:
@ -306,7 +306,7 @@ class ParseSnapshot:
) )
def get_sound_card(self): def get_sound_card(self):
audio = get_inxi_key(self.inxi, "Audio") or [] audio = get_inxi_key(self.inxi, "Audio")
for c in audio: for c in audio:
model = get_inxi(c, "Device") model = get_inxi(c, "Device")
@ -323,7 +323,7 @@ class ParseSnapshot:
) )
def get_display(self): def get_display(self):
graphics = get_inxi_key(self.inxi, "Graphics") or [] graphics = get_inxi_key(self.inxi, "Graphics")
for c in graphics: for c in graphics:
if not get_inxi(c, "Monitor"): if not get_inxi(c, "Monitor"):
continue continue