Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldmitry committed Oct 16, 2024
1 parent ff6ce1c commit 155c90c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "cosl"
version = "0.0.41"
version = "0.0.42"
authors = [
{ name="sed-i", email="[email protected]" },
]
Expand Down
6 changes: 3 additions & 3 deletions src/cosl/coordinated_workers/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ class S3ConnectionInfo(pydantic.BaseModel):

endpoint: str
bucket: str
access_key: str = pydantic.Field(alias="access-key")
secret_key: str = pydantic.Field(alias="secret-key")
access_key: str = pydantic.Field(alias="access-key") # type: ignore
secret_key: str = pydantic.Field(alias="secret-key") # type: ignore

region: Optional[str] = pydantic.Field(None)
tls_ca_chain: Optional[List[str]] = pydantic.Field(None, alias="tls-ca-chain")
tls_ca_chain: Optional[List[str]] = pydantic.Field(None, alias="tls-ca-chain") # type: ignore

@property
def ca_cert(self) -> Optional[str]:
Expand Down
7 changes: 2 additions & 5 deletions src/cosl/coordinated_workers/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,7 @@ def publish_data(
) -> None:
"""Publish the config to all related worker clusters."""
for relation in self._relations:
if relation:
if not self._has_worker_published(relation):
log.debug("Worker %s hasn't yet published its data", relation.app.name)
continue
if relation and self._remote_data_ready(relation):
local_app_databag = ClusterProviderAppData(
worker_config=worker_config,
loki_endpoints=loki_endpoints,
Expand Down Expand Up @@ -406,7 +403,7 @@ def get_address_from_role(self, role: str) -> Optional[str]:
return address_set.pop()
return None

def _has_worker_published(self, relation: ops.Relation) -> bool:
def _remote_data_ready(self, relation: ops.Relation) -> bool:
"""Verify that each worker unit and the worker leader have published their data to the cluster relation.
- unit address is published
Expand Down

0 comments on commit 155c90c

Please sign in to comment.