From 1800c8ecd701baf177fa39f239ab1b1e4dadee36 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Fri, 22 Dec 2023 14:46:52 +0300 Subject: [PATCH] debug: add prints to rebuild_system --- selfprivacy_api/actions/system.py | 4 ++++ selfprivacy_api/graphql/mutations/system_mutations.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/selfprivacy_api/actions/system.py b/selfprivacy_api/actions/system.py index e9ac6b4..ef6215d 100644 --- a/selfprivacy_api/actions/system.py +++ b/selfprivacy_api/actions/system.py @@ -60,10 +60,14 @@ def set_auto_upgrade_settings( def rebuild_system() -> int: """Rebuild the system""" + print("entered system_actions.rebuild_system") rebuild_result = subprocess.Popen( ["systemctl", "start", "sp-nixos-rebuild.service"], start_new_session=True ) + print("Called subprocess") rebuild_result.communicate()[0] + print("Communicated with subproccess, return code:") + print(rebuild_result) return rebuild_result.returncode diff --git a/selfprivacy_api/graphql/mutations/system_mutations.py b/selfprivacy_api/graphql/mutations/system_mutations.py index daada17..f6c77d1 100644 --- a/selfprivacy_api/graphql/mutations/system_mutations.py +++ b/selfprivacy_api/graphql/mutations/system_mutations.py @@ -78,7 +78,9 @@ class SystemMutations: @strawberry.mutation(permission_classes=[IsAuthenticated]) def run_system_rebuild(self) -> GenericMutationReturn: + print("Recieved runSystemRebuild command") system_actions.rebuild_system() + print("exited system_actions.rebuild_system") return GenericMutationReturn( success=True, message="Starting rebuild system",