Skip to content

Commit

Permalink
Copy the status docstrings from ops.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyandrewmeyer committed Jul 9, 2024
1 parent 4b79027 commit 3ee146e
Showing 1 changed file with 6 additions and 36 deletions.
42 changes: 6 additions & 36 deletions scenario/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,11 +888,7 @@ def from_ops(cls, obj: StatusBase) -> "_EntityStatus":

@dataclasses.dataclass(frozen=True, eq=False, repr=False)
class UnknownStatus(_EntityStatus, ops.UnknownStatus):
"""The unit status is unknown.
A unit-agent has finished calling install, config-changed, and start, but the
charm has not called status-set yet.
"""
__doc__ = ops.UnknownStatus.__doc__

name: Literal["unknown"] = "unknown"

Expand All @@ -903,11 +899,7 @@ def __init__(self):

@dataclasses.dataclass(frozen=True, eq=False, repr=False)
class ErrorStatus(_EntityStatus, ops.ErrorStatus):
"""The unit status is error.
The unit-agent has encountered an error (the application or unit requires
human intervention in order to operate correctly).
"""
__doc__ = ops.ErrorStatus.__doc__

name: Literal["error"] = "error"

Expand All @@ -918,11 +910,7 @@ def __init__(self, message: str = ""):

@dataclasses.dataclass(frozen=True, eq=False, repr=False)
class ActiveStatus(_EntityStatus, ops.ActiveStatus):
"""The unit/app is ready.
Use the :attr:`message` to provide details when the unit/app is operational
but in a degraded state (such as lacking high availability).
"""
__doc__ = ops.ActiveStatus.__doc__

name: Literal["active"] = "active"

Expand All @@ -933,10 +921,7 @@ def __init__(self, message: str = ""):

@dataclasses.dataclass(frozen=True, eq=False, repr=False)
class BlockedStatus(_EntityStatus, ops.BlockedStatus):
"""The unit/app requires manual intervention.
An admin has to manually intervene to unblock the unit/app and let it proceed.
"""
__doc__ = ops.BlockedStatus.__doc__

name: Literal["blocked"] = "blocked"

Expand All @@ -947,15 +932,7 @@ def __init__(self, message: str = ""):

@dataclasses.dataclass(frozen=True, eq=False, repr=False)
class MaintenanceStatus(_EntityStatus, ops.MaintenanceStatus):
"""The unit/app is performing maintenance tasks.
The unit/app is performing an operation such as ``apt install`` or waiting for
something under its control, such as ``pebble-ready`` or an ``exec``
operation in the workload container.
In constrast to :class:`WaitingStatus`, ``MaintenanceStatus`` reflects
activity on this unit or charm, not on peers or related units.
"""
__doc__ = ops.MaintenanceStatus.__doc__

name: Literal["maintenance"] = "maintenance"

Expand All @@ -966,14 +943,7 @@ def __init__(self, message: str = ""):

@dataclasses.dataclass(frozen=True, eq=False, repr=False)
class WaitingStatus(_EntityStatus, ops.WaitingStatus):
"""The unit/app is waiting on an integration.
The unit/app is waiting on a charm with which it is integrated, such as
waiting for an integrated database charm to provide credentials.
In contrast to :class:`MaintenanceStatus`, ``WaitingStatus`` reflects
activity on related units, not on this unit or charm.
"""
__doc__ = ops.WaitingStatus.__doc__

name: Literal["waiting"] = "waiting"

Expand Down

0 comments on commit 3ee146e

Please sign in to comment.