Skip to content

Commit

Permalink
try fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasgameiroborges committed Nov 21, 2024
1 parent ede9c4d commit 644ea77
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
Binary file added psycopg2-2.9.10-cp310-cp310-linux_x86_64.whl
Binary file not shown.
8 changes: 8 additions & 0 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1716,6 +1716,14 @@ def update_config(self, is_creating_backup: bool = False) -> bool:
return True

if not self._patroni.member_started:
if enable_tls:
logger.debug(
"Early exit update_config: patroni not responding but TLS is enabled."
)
self.unit_peer_data.update({"tls": "enabled"})
self.postgresql_client_relation.update_endpoints()
# self._handle_postgresql_restart_need(True)
return True
logger.debug("Early exit update_config: Patroni not started yet")
return False

Expand Down
2 changes: 0 additions & 2 deletions tests/integration/test_subordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ async def test_deploy(ops_test: OpsTest, charm: str, github_secrets):
config={"token": github_secrets["UBUNTU_PRO_TOKEN"]},
channel="latest/edge",
num_units=0,
base=CHARM_BASE,
),
ops_test.model.deploy(
LS_CLIENT,
Expand All @@ -46,7 +45,6 @@ async def test_deploy(ops_test: OpsTest, charm: str, github_secrets):
},
channel="latest/edge",
num_units=0,
base=CHARM_BASE,
),
)

Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1338,6 +1338,7 @@ def test_update_config(harness):
harness.update_relation_data(
rel_id, harness.charm.unit.name, {"tls": ""}
) # Mock some data in the relation to test that it doesn't change.
_is_tls_enabled.return_value = False
harness.charm.update_config()
_handle_postgresql_restart_need.assert_not_called()
assert "tls" not in harness.get_relation_data(rel_id, harness.charm.unit.name)
Expand Down

0 comments on commit 644ea77

Please sign in to comment.