Skip to content

Commit 1754b76

Browse files
[LDAP] Comment snap service restart
1 parent 181cd24 commit 1754b76

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/charm.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2090,7 +2090,11 @@ def update_config(self, is_creating_backup: bool = False) -> bool:
20902090

20912091
self._handle_postgresql_restart_need()
20922092
self._restart_metrics_service()
2093-
self._restart_ldap_sync_service()
2093+
2094+
# TODO: Un-comment
2095+
# When PostgreSQL-rock wrapping PostgreSQL-snap versions 162 / 163 gets published
2096+
# (i.e. snap contains https://github.com/canonical/charmed-postgresql-snap/pull/88)
2097+
# self._restart_ldap_sync_service()
20942098

20952099
return True
20962100

tests/unit/test_charm.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,13 +1711,13 @@ def test_update_config(harness):
17111711
)
17121712
_handle_postgresql_restart_need.assert_called_once()
17131713
_restart_metrics_service.assert_called_once()
1714-
_restart_ldap_sync_service.assert_called_once()
1714+
# _restart_ldap_sync_service.assert_called_once()
17151715
assert "tls" not in harness.get_relation_data(rel_id, harness.charm.unit.name)
17161716

17171717
# Test with TLS files available.
17181718
_handle_postgresql_restart_need.reset_mock()
17191719
_restart_metrics_service.reset_mock()
1720-
_restart_ldap_sync_service.reset_mock()
1720+
# _restart_ldap_sync_service.reset_mock()
17211721
harness.update_relation_data(
17221722
rel_id, harness.charm.unit.name, {"tls": ""}
17231723
) # Mock some data in the relation to test that it change.
@@ -1740,7 +1740,7 @@ def test_update_config(harness):
17401740
)
17411741
_handle_postgresql_restart_need.assert_called_once()
17421742
_restart_metrics_service.assert_called_once()
1743-
_restart_ldap_sync_service.assert_called_once()
1743+
# _restart_ldap_sync_service.assert_called_once()
17441744
assert "tls" not in harness.get_relation_data(
17451745
rel_id, harness.charm.unit.name
17461746
) # The "tls" flag is set in handle_postgresql_restart_need.
@@ -1751,11 +1751,11 @@ def test_update_config(harness):
17511751
) # Mock some data in the relation to test that it change.
17521752
_handle_postgresql_restart_need.reset_mock()
17531753
_restart_metrics_service.reset_mock()
1754-
_restart_ldap_sync_service.reset_mock()
1754+
# _restart_ldap_sync_service.reset_mock()
17551755
harness.charm.update_config()
17561756
_handle_postgresql_restart_need.assert_not_called()
17571757
_restart_metrics_service.assert_not_called()
1758-
_restart_ldap_sync_service.assert_not_called()
1758+
# _restart_ldap_sync_service.assert_not_called()
17591759
assert harness.get_relation_data(rel_id, harness.charm.unit.name)["tls"] == "enabled"
17601760

17611761
# Test with member not started yet.
@@ -1765,7 +1765,7 @@ def test_update_config(harness):
17651765
harness.charm.update_config()
17661766
_handle_postgresql_restart_need.assert_not_called()
17671767
_restart_metrics_service.assert_not_called()
1768-
_restart_ldap_sync_service.assert_not_called()
1768+
# _restart_ldap_sync_service.assert_not_called()
17691769
assert "tls" not in harness.get_relation_data(rel_id, harness.charm.unit.name)
17701770

17711771

0 commit comments

Comments
 (0)