14 lines
516 B
Python
14 lines
516 B
Python
def compute_display_state(active_operation: str | None, actual_state: str) -> str:
|
|
if active_operation == "delete":
|
|
return "deleting"
|
|
if active_operation == "start":
|
|
return "starting"
|
|
if active_operation == "stop":
|
|
return "stopping"
|
|
if active_operation == "initialize":
|
|
return "initializing"
|
|
return actual_state
|
|
|
|
|
|
def has_drift(desired_state: str, actual_state: str, has_active_job: bool) -> bool:
|
|
return (not has_active_job) and desired_state != actual_state
|