feat(system): add worker and VPS catalogs with guarded local removal

This commit is contained in:
DCCONSTRUCTIONS
2026-11-10 01:11:24 +03:00
parent ad5a929e06
commit e8025bc99f
25 changed files with 1556 additions and 116 deletions
+17 -1
View File
@@ -345,9 +345,25 @@ class Manager:
raise ValueError("Invalid helper request")
with self.lock:
action = body.get("action")
if action not in ("prepare", "status", "stage", "confirm", "apply", "disable", "rollback"):
if action not in (
"prepare", "status", "stage", "confirm", "apply", "disable", "rollback", "forget",
):
raise ValueError("Unknown action")
identity = server_id(body.get("server_id"))
if action == "forget":
row = self.profiles.get(identity)
if row is not None:
if row.get("pending"):
raise ValueError("A network change is pending")
self.down(row)
del self.profiles[identity]
try:
self.persist()
except Exception:
self.profiles[identity] = row
raise
self.restore_retry.pop(identity, None)
return {"server_id": identity, "removed": True}
row = self.prepare(identity)
if action in ("stage", "apply"):
config = body["config"]