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:
+9
-3
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user