Skip to content

Commit

Permalink
Merge pull request #63 from juju/3.3-into-3.4
Browse files Browse the repository at this point in the history
Merge 3.3 into 3.4
  • Loading branch information
manadart authored Feb 7, 2024
2 parents d8fb619 + 470f7c5 commit 245bac2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from ops.framework import StoredState
from ops.charm import RelationJoinedEvent, RelationDepartedEvent
from ops.main import main
from ops.model import ActiveStatus, BlockedStatus, ErrorStatus, Relation
from ops.model import ActiveStatus, BlockedStatus, Relation
from typing import List

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -84,7 +84,8 @@ def _on_metrics_endpoint_relation_created(self, event: RelationJoinedEvent):
try:
api_port = self.api_port()
except AgentConfException as e:
self.unit.status = ErrorStatus(f"can't read controller API port from agent.conf: {e}")
self.unit.status = BlockedStatus(
f"can't read controller API port from agent.conf: {e}")
return

metrics_endpoint = MetricsEndpointProvider(
Expand Down
4 changes: 2 additions & 2 deletions tests/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os
import unittest
from charm import JujuControllerCharm, AgentConfException
from ops import ErrorStatus
from ops import BlockedStatus
from ops.testing import Harness
from unittest.mock import mock_open, patch

Expand Down Expand Up @@ -140,7 +140,7 @@ def test_apiaddresses_missing_status(self, *_):
harness.begin()

harness.add_relation('metrics-endpoint', 'prometheus-k8s')
self.assertEqual(harness.charm.unit.status, ErrorStatus(
self.assertEqual(harness.charm.unit.status, BlockedStatus(
"can't read controller API port from agent.conf: agent.conf key 'apiaddresses' missing"
))

Expand Down

0 comments on commit 245bac2

Please sign in to comment.