Return native Engine NotFound faults and clear Web UI session on 401.

Include the bad id in host/datacenter/cluster errors, expire stale auth in the
console, and document Ingress annotations that preserve fault bodies.
This commit is contained in:
2026-07-22 06:52:04 +03:00
parent 9c94df119b
commit af26ad4141
18 changed files with 456 additions and 61 deletions
+9 -3
View File
@@ -244,11 +244,17 @@ def user_entity(row: Any) -> dict[str, Any]:
}
def generic_entity(collection: str, element: str, row: Any) -> dict[str, Any]:
def generic_entity(
collection: str,
element: str,
row: Any,
*,
entity_id: str | None = None,
) -> dict[str, Any]:
if row is None:
from app.ovirt.errors import OVirtError
from app.ovirt.common import no_such
raise OVirtError("NotFound", f"{element} not found", status_code=404)
raise no_such(element, entity_id or "unknown")
oid = str(row["id"])
data = _data(row)
entity = {