From 5ec690da939ff5b2efb3ba2ffe177cb035c25ee6 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Thu, 18 Nov 2021 21:18:41 +0000 Subject: Adding a cmd_history.txt log under /var/log/archinstall/ (#737) * Adding a cmd_history.txt log under /var/log/archinstall/ to get a clear picture of which commands was executed. --- archinstall/lib/disk/helpers.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'archinstall/lib/disk/helpers.py') diff --git a/archinstall/lib/disk/helpers.py b/archinstall/lib/disk/helpers.py index e15e69b2..fea9ef65 100644 --- a/archinstall/lib/disk/helpers.py +++ b/archinstall/lib/disk/helpers.py @@ -182,9 +182,16 @@ def get_filesystem_type(path): def disk_layouts(): try: - return json.loads(SysCommand("lsblk -f -o+TYPE,SIZE -J").decode('UTF-8')) + if (handle := SysCommand("lsblk -f -o+TYPE,SIZE -J")).exit_code == 0: + return json.loads(handle.decode('UTF-8')) + else: + log(f"Could not return disk layouts: {handle}", level=logging.WARNING, fg="yellow") + return None except SysCallError as err: - log(f"Could not return disk layouts: {err}") + log(f"Could not return disk layouts: {err}", level=logging.WARNING, fg="yellow") + return None + except json.decoder.JSONDecodeError as err: + log(f"Could not return disk layouts: {err}", level=logging.WARNING, fg="yellow") return None -- cgit v1.2.3-54-g00ecf