Skip to content

Commit

Permalink
statuc
Browse files Browse the repository at this point in the history
  • Loading branch information
PietroPasotti committed Oct 2, 2024
1 parent 293d752 commit f7cd395
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/cosl/coordinated_workers/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import ops
import pydantic
import yaml
from ops import StatusBase

import cosl
from cosl.coordinated_workers import worker
Expand Down Expand Up @@ -452,7 +453,8 @@ def tls_available(self) -> bool:
def s3_connection_info(self) -> S3ConnectionInfo:
"""Cast and validate the untyped s3 databag to something we can handle."""
try:
return S3ConnectionInfo(**self.s3_requirer.get_s3_connection_info())
# we have to type-ignore here because the s3 lib's type annotation is wrong
return S3ConnectionInfo(**self.s3_requirer.get_s3_connection_info()) # type: ignore
except pydantic.ValidationError:
raise S3NotFoundError("s3 integration inactive or interface corrupt")

Expand Down Expand Up @@ -633,7 +635,7 @@ def _on_config_changed(self, _: ops.ConfigChangedEvent):
# keep this event handler at the bottom
def _on_collect_unit_status(self, e: ops.CollectStatusEvent):
# todo add [nginx.workload] statuses
statuses = []
statuses: List[StatusBase] = []

if self.resources_patch and self.resources_patch.get_status().name != "active":
statuses.append(self.resources_patch.get_status())
Expand Down

0 comments on commit f7cd395

Please sign in to comment.