mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 01:13:00 +02:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52735154ad |
@@ -78,13 +78,18 @@ def usb_port_components(systemjson):
|
||||
|
||||
|
||||
def operational():
|
||||
systemjson = HOST.read_json("/run/system.json")
|
||||
try:
|
||||
systemjson = HOST.read_json("/run/system.json")
|
||||
vpd_components(systemjson)
|
||||
usb_port_components(systemjson)
|
||||
components = vpd_component + usb_port_components + []
|
||||
|
||||
except:
|
||||
components = []
|
||||
|
||||
return {
|
||||
"ietf-hardware:hardware": {
|
||||
"component":
|
||||
vpd_components(systemjson) +
|
||||
usb_port_components(systemjson) +
|
||||
[],
|
||||
components
|
||||
},
|
||||
}
|
||||
|
||||
@@ -171,19 +171,25 @@ def add_software(out):
|
||||
except subprocess.CalledProcessError:
|
||||
pass # Maybe an upgrade i progress, then rauc does not respond
|
||||
|
||||
installer_status = HOST.run_json(["rauc-installation-status"])
|
||||
installer = {}
|
||||
if installer_status.get("operation"):
|
||||
installer["operation"] = installer_status["operation"]
|
||||
if "progress" in installer_status:
|
||||
progress = {}
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
if installer_status["progress"].get("percentage"):
|
||||
progress["percentage"] = int(installer_status["progress"]["percentage"])
|
||||
if installer_status["progress"].get("message"):
|
||||
progress["message"] = installer_status["progress"]["message"]
|
||||
installer["progress"] = progress
|
||||
software["installer"] = installer
|
||||
installer = {}
|
||||
try:
|
||||
installer_status = HOST.run_json(["rauc-installation-status"])
|
||||
if installer_status.get("operation"):
|
||||
installer["operation"] = installer_status["operation"]
|
||||
if "progress" in installer_status:
|
||||
progress = {}
|
||||
|
||||
if installer_status["progress"].get("percentage"):
|
||||
progress["percentage"] = int(installer_status["progress"]["percentage"])
|
||||
if installer_status["progress"].get("message"):
|
||||
progress["message"] = installer_status["progress"]["message"]
|
||||
installer["progress"] = progress
|
||||
software["installer"] = installer
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
insert(out, "infix-system:software", software)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user