26 lines
821 B
Python
26 lines
821 B
Python
"""Separate read, write, and release plane readiness evaluation."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
from typing import Mapping
|
|
|
|
|
|
@dataclass(frozen=True, slots=True)
|
|
class RuntimeStatus:
|
|
read_plane: Mapping[str, bool]
|
|
write_plane: Mapping[str, bool]
|
|
release_plane: Mapping[str, bool]
|
|
|
|
@property
|
|
def release_control_plane_ready(self) -> bool:
|
|
return all(self.read_plane.values()) and all(self.write_plane.values()) and all(self.release_plane.values())
|
|
|
|
def as_dict(self) -> dict[str, object]:
|
|
return {
|
|
"READ_PLANE": dict(self.read_plane),
|
|
"WRITE_PLANE": dict(self.write_plane),
|
|
"RELEASE_PLANE": dict(self.release_plane),
|
|
"release_control_plane_ready": self.release_control_plane_ready,
|
|
}
|