From 360a1b4f337e45b2dc26c9af067e53fbd364231f Mon Sep 17 00:00:00 2001 From: Daniel Girtler Date: Sun, 24 Sep 2023 18:14:02 +1000 Subject: Unify json functions (#2102) Co-authored-by: Daniel Girtler --- archinstall/lib/general.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'archinstall/lib/general.py') diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py index e22e7eed..71981fb6 100644 --- a/archinstall/lib/general.py +++ b/archinstall/lib/general.py @@ -69,8 +69,6 @@ def jsonify(obj: Any, safe: bool = True) -> Any: # a dictionary representation of the object so that it can be # processed by the json library. return jsonify(obj.json(), safe) - if hasattr(obj, '__dump__'): - return obj.__dump__() if isinstance(obj, (datetime, date)): return obj.isoformat() if isinstance(obj, (list, set, tuple)): @@ -462,13 +460,13 @@ def run_custom_user_commands(commands :List[str], installation :Installer) -> No for index, command in enumerate(commands): script_path = f"/var/tmp/user-command.{index}.sh" chroot_path = f"{installation.target}/{script_path}" - + info(f'Executing custom command "{command}" ...') with open(chroot_path, "w") as user_script: user_script.write(command) - + SysCommand(f"arch-chroot {installation.target} bash {script_path}") - + os.unlink(chroot_path) -- cgit v1.2.3-54-g00ecf