Skip to content

Commit 09d4f20

Browse files
authored
Switch prometheus exporter (#204)
1 parent dd94b4b commit 09d4f20

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

lib/charms/data_platform_libs/v0/data_interfaces.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def _on_topic_requested(self, event: TopicRequestedEvent):
306306
RelationEvent,
307307
)
308308
from ops.framework import EventSource, Object
309-
from ops.model import Application, Relation, Unit
309+
from ops.model import Application, ModelError, Relation, Unit
310310

311311
# The unique Charmhub library identifier, never change it
312312
LIBID = "6c3e6b6680d64e9c89e611d1a15f65be"
@@ -316,7 +316,7 @@ def _on_topic_requested(self, event: TopicRequestedEvent):
316316

317317
# Increment this PATCH version before using `charmcraft publish-lib` or reset
318318
# to 0 if you are raising the major API version
319-
LIBPATCH = 15
319+
LIBPATCH = 16
320320

321321
PYDEPS = ["ops>=2.0.0"]
322322

@@ -569,7 +569,7 @@ def _is_relation_active(relation: Relation):
569569
try:
570570
_ = repr(relation.data)
571571
return True
572-
except RuntimeError:
572+
except (RuntimeError, ModelError):
573573
return False
574574

575575
@staticmethod

lib/charms/data_platform_libs/v0/s3.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def _on_credential_gone(self, event: CredentialsGoneEvent):
137137

138138
# Increment this PATCH version before using `charmcraft publish-lib` or reset
139139
# to 0 if you are raising the major API version
140-
LIBPATCH = 3
140+
LIBPATCH = 4
141141

142142
logger = logging.getLogger(__name__)
143143

@@ -752,11 +752,11 @@ def _on_relation_changed(self, event: RelationChangedEvent) -> None:
752752

753753
def get_s3_connection_info(self) -> Dict[str, str]:
754754
"""Return the s3 credentials as a dictionary."""
755-
relation = self.charm.model.get_relation(self.relation_name)
756-
if not relation or not relation.app:
757-
return {}
755+
for relation in self.relations:
756+
if relation and relation.app:
757+
return self._load_relation_data(relation.data[relation.app])
758758

759-
return self._load_relation_data(relation.data[relation.app])
759+
return {}
760760

761761
def _on_relation_broken(self, event: RelationBrokenEvent) -> None:
762762
"""Notify the charm about a broken S3 credential store relation."""

metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ resources:
2626
postgresql-image:
2727
type: oci-image
2828
description: OCI image for PostgreSQL
29-
upstream-source: ghcr.io/canonical/charmed-postgresql@sha256:137323ff550d310a7f004561b1df90494b8ba6e344397dea2c6cb9c049b22f5b
29+
upstream-source: ghcr.io/canonical/charmed-postgresql@sha256:2181002bffd2e8aa7ddf3e5584629b3fa5ac47ab7fa0b1627bc2e093331bbd59
3030

3131
peers:
3232
database-peers:

0 commit comments

Comments
 (0)