Skip to content

Commit

Permalink
Merge pull request #64 from juju/3.4-into-3.5
Browse files Browse the repository at this point in the history
Merge 3.4 into 3.5
  • Loading branch information
manadart authored Feb 10, 2024
2 parents d8fb619 + 209f9c8 commit 5ac10db
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Licensed under the GPLv3, see LICENSE file for details.
name: juju-controller
assumes:
- juju >= 3.3
- juju >= 3.5
description: |
The Juju controller charm is used to expose various pieces
of functionality of a Juju controller.
Expand Down
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 5ac10db

Please sign in to comment.