feat(system): add worker and VPS catalogs with guarded local removal
This commit is contained in:
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user