Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,478 changes: 2,855 additions & 623 deletions lib/charms/data_platform_libs/v0/data_interfaces.py

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions lib/charms/data_platform_libs/v0/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def _on_credential_gone(self, event: CredentialsGoneEvent):
```

"""

import json
import logging
from collections import namedtuple
Expand Down Expand Up @@ -137,7 +138,7 @@ def _on_credential_gone(self, event: CredentialsGoneEvent):

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 5
LIBPATCH = 6

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -354,7 +355,7 @@ def update_connection_info(self, relation_id: int, connection_data: dict) -> Non
updated_connection_data[configuration_option] = configuration_value

relation.data[self.local_app].update(updated_connection_data)
logger.debug(f"Updated S3 connection info: {updated_connection_data}")
logger.debug("Updated S3 connection info.")

@property
def relations(self) -> List[Relation]:
Expand Down Expand Up @@ -721,7 +722,7 @@ def update_connection_info(self, relation_id: int, connection_data: dict) -> Non
updated_connection_data[configuration_option] = configuration_value

relation.data[self.local_app].update(updated_connection_data)
logger.debug(f"Updated S3 credentials: {updated_connection_data}")
logger.debug("Updated S3 credentials.")

def _load_relation_data(self, raw_relation_data: RelationDataContent) -> Dict[str, str]:
"""Loads relation data from the relation data bag.
Expand Down
1,013 changes: 594 additions & 419 deletions lib/charms/grafana_k8s/v0/grafana_dashboard.py

Large diffs are not rendered by default.

640 changes: 222 additions & 418 deletions lib/charms/loki_k8s/v1/loki_push_api.py

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions lib/charms/observability_libs/v0/juju_topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
```

"""

import warnings
from collections import OrderedDict
from typing import Dict, List, Optional
from uuid import UUID
Expand All @@ -75,7 +77,7 @@
LIBID = "bced1658f20f49d28b88f61f83c2d232"

LIBAPI = 0
LIBPATCH = 6
LIBPATCH = 7


class InvalidUUIDError(Exception):
Expand Down Expand Up @@ -119,6 +121,13 @@ def __init__(
unit: a unit name as a string
charm_name: name of charm as a string
"""
warnings.warn(
"""
observability_libs.v0.juju_topology is deprecated. Please import the
library from `cosl` instead: https://github.com/canonical/cos-lib
""",
DeprecationWarning,
)
if not self.is_valid_uuid(model_uuid):
raise InvalidUUIDError(model_uuid)

Expand Down Expand Up @@ -215,7 +224,8 @@ def as_dict(

if remapped_keys:
ret = OrderedDict(
(remapped_keys.get(k), v) if remapped_keys.get(k) else (k, v) for k, v in ret.items() # type: ignore
(remapped_keys.get(k), v) if remapped_keys.get(k) else (k, v)
for k, v in ret.items() # type: ignore
)

return ret
Expand Down
Loading