Keep B2 client fixes and move VPS implementation to its standalone repository

This commit is contained in:
DCCONSTRUCTIONS
2026-09-29 12:41:21 +03:00
parent 03d44d0fb1
commit 6dd652f71e
85 changed files with 2201 additions and 9299 deletions
+24 -3
View File
@@ -20,12 +20,24 @@ ATTEMPT_FACTS = {
"stage",
"queue_seconds",
"attempt_expires_at",
"delivered_at",
"delivery_seconds",
}
KINDS = {"request-position", "restart", "read-configuration", "configure-all", "select-sim"}
KINDS = {
"request-position",
"restart",
"read-configuration",
"configure-all",
"select-sim",
"set-output",
"pulse-output",
}
def supported(host, kind):
if kind in {"set-output", "pulse-output"}:
return "arnavi-b2-command-scheduler-v2" in host.get("status", {}).get("capabilities", [])
return kind in KINDS and "arnavi-b2-durable-operations-v1" in host.get("status", {}).get(
"capabilities", []
)
@@ -61,8 +73,17 @@ def project(op, result):
op["runtime_phase"] = phase
if result.get("stop_requested") is True:
op["stop_requested"] = True
if result.get("reason") == "sim_card_changed":
op["reason"] = "sim_card_changed"
if result.get("reason") in {
"sim_card_changed",
"delivery_deadline",
"connection_closed",
"host_restarted",
"socket_error",
"write_failed",
"expired_before_write",
"pulse_result_unknown",
}:
op["reason"] = result["reason"]
def disconnected(equipment, identifier, operation_id):