mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-10 13:03:11 +00:00
refactor(system): break out rebuild job creation
This commit is contained in:
parent
f068329153
commit
7ae550fd26
|
@ -106,14 +106,18 @@ def run_blocking(cmd: List[str], new_session: bool = False) -> str:
|
||||||
return stdout
|
return stdout
|
||||||
|
|
||||||
|
|
||||||
def rebuild_system() -> Job:
|
def add_rebuild_job() -> Job:
|
||||||
"""Rebuild the system"""
|
return Jobs.add(
|
||||||
job = Jobs.add(
|
|
||||||
type_id="system.nixos.rebuild",
|
type_id="system.nixos.rebuild",
|
||||||
name="Rebuild system",
|
name="Rebuild system",
|
||||||
description="Applying the new system configuration by building the new NixOS generation.",
|
description="Applying the new system configuration by building the new NixOS generation.",
|
||||||
status=JobStatus.CREATED,
|
status=JobStatus.CREATED,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def rebuild_system() -> Job:
|
||||||
|
"""Rebuild the system"""
|
||||||
|
job = add_rebuild_job()
|
||||||
rebuild_system_task(job)
|
rebuild_system_task(job)
|
||||||
return job
|
return job
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue