debug: add prints to rebuild_system

This commit is contained in:
Inex Code 2023-12-22 14:46:52 +03:00
parent 97984d2644
commit 1800c8ecd7
2 changed files with 6 additions and 0 deletions

View file

@ -60,10 +60,14 @@ def set_auto_upgrade_settings(
def rebuild_system() -> int: def rebuild_system() -> int:
"""Rebuild the system""" """Rebuild the system"""
print("entered system_actions.rebuild_system")
rebuild_result = subprocess.Popen( rebuild_result = subprocess.Popen(
["systemctl", "start", "sp-nixos-rebuild.service"], start_new_session=True ["systemctl", "start", "sp-nixos-rebuild.service"], start_new_session=True
) )
print("Called subprocess")
rebuild_result.communicate()[0] rebuild_result.communicate()[0]
print("Communicated with subproccess, return code:")
print(rebuild_result)
return rebuild_result.returncode return rebuild_result.returncode

View file

@ -78,7 +78,9 @@ class SystemMutations:
@strawberry.mutation(permission_classes=[IsAuthenticated]) @strawberry.mutation(permission_classes=[IsAuthenticated])
def run_system_rebuild(self) -> GenericMutationReturn: def run_system_rebuild(self) -> GenericMutationReturn:
print("Recieved runSystemRebuild command")
system_actions.rebuild_system() system_actions.rebuild_system()
print("exited system_actions.rebuild_system")
return GenericMutationReturn( return GenericMutationReturn(
success=True, success=True,
message="Starting rebuild system", message="Starting rebuild system",