Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib
diff options
context:
space:
mode:
authorRichard Neumann <mail@richard-neumann.de>2021-09-06 16:12:53 +0200
committerRichard Neumann <mail@richard-neumann.de>2021-09-06 16:12:53 +0200
commit8841e209ee7d0cadb7b7c68e5001b4c006d3714b (patch)
tree78798ec0a6832b369fcb2181c1ad6d39512a16dc /archinstall/lib
parent086dcc3325706af63fb3827df14874839f4208a4 (diff)
Refactor cpu_model() to use cpuinfo()
Diffstat (limited to 'archinstall/lib')
-rw-r--r--archinstall/lib/hardware.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py
index d5bdc98f..416045c4 100644
--- a/archinstall/lib/hardware.py
+++ b/archinstall/lib/hardware.py
@@ -118,13 +118,10 @@ def cpu_vendor() -> Optional[str]:
def cpu_model() -> Optional[str]:
- cpu_info_raw = SysCommand("lscpu -J")
- cpu_info = json.loads(b"".join(cpu_info_raw).decode('UTF-8'))['lscpu']
+ for cpu in cpuinfo():
+ return cpu.get("model name")
- for info in cpu_info:
- if info.get('field', None) == "Model name:":
- return info.get('data', None)
- return
+ return None
def sys_vendor() -> Optional[str]: