From c851c3d193b3a3afcdda48c2ec3ba61b001eaed3 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Mon, 12 Feb 2024 18:53:14 +0300 Subject: [PATCH] chore: more debugging outuput --- selfprivacy_api/jobs/upgrade_system.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/selfprivacy_api/jobs/upgrade_system.py b/selfprivacy_api/jobs/upgrade_system.py index 13e6fb9..8a1e845 100644 --- a/selfprivacy_api/jobs/upgrade_system.py +++ b/selfprivacy_api/jobs/upgrade_system.py @@ -66,8 +66,9 @@ def rebuild_system_task(job: Job, upgrade: bool = False): capture_output=True, text=True, ) - print(status.stdout.strip()) + print(f"Unit status: {status.stdout.strip()}") if status.stdout.strip() == "inactive": + print("System rebuilt.") Jobs.update( job=job, status=JobStatus.FINISHED, @@ -76,6 +77,7 @@ def rebuild_system_task(job: Job, upgrade: bool = False): ) break elif status.stdout.strip() == "failed": + print("System rebuild failed.") Jobs.update( job=job, status=JobStatus.ERROR, @@ -106,6 +108,7 @@ def rebuild_system_task(job: Job, upgrade: bool = False): ) # Timeout of 60 minutes if time.time() - start_time > 3600: + print("System rebuild timed out.") Jobs.update( job=job, status=JobStatus.ERROR, @@ -114,6 +117,7 @@ def rebuild_system_task(job: Job, upgrade: bool = False): break time.sleep(5) except subprocess.CalledProcessError: + print("subprocess.CalledProcessError") pass except subprocess.CalledProcessError as e: