mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-28 23:11:29 +00:00
feat: Add system reboot after NixOS build during flake migration
This commit is contained in:
parent
431165ca74
commit
c7f9909209
|
@ -4,8 +4,10 @@ import subprocess
|
|||
import tempfile
|
||||
import tarfile
|
||||
import shutil
|
||||
import time
|
||||
import urllib.request
|
||||
from selfprivacy_api.jobs import JobStatus, Jobs
|
||||
import selfprivacy_api.actions.system as system_actions
|
||||
|
||||
from selfprivacy_api.migrations.migration import Migration
|
||||
|
||||
|
@ -249,7 +251,7 @@ class MigrateToFlakes(Migration):
|
|||
)
|
||||
print("================================")
|
||||
print(
|
||||
"NixOS built. You may reboot now! Creating a notification for the app"
|
||||
"NixOS built. Rebooting soon!"
|
||||
)
|
||||
print("================================")
|
||||
|
||||
|
@ -257,11 +259,15 @@ class MigrateToFlakes(Migration):
|
|||
name="NixOS upgrade to 23.11",
|
||||
type_id="migrations.migrate_to_flakes",
|
||||
status=JobStatus.FINISHED,
|
||||
status_text="New system built. Reboot your server to apply.",
|
||||
status_text="New system built. Check your server API version: if it is 3.0.0 or higher, you've successfully migrated",
|
||||
progress=100,
|
||||
description="Migration to the modular SelfPrivacy system",
|
||||
)
|
||||
|
||||
time.sleep(5)
|
||||
|
||||
system_actions.reboot_system()
|
||||
|
||||
except Exception as error:
|
||||
os.chdir(current_working_directory)
|
||||
print("Error")
|
||||
|
|
Loading…
Reference in a new issue