Fix misc issues with removal of ceph relation

Ensure that services are restarted when the relation is
removed from a model.

Add -departed hook to ensure that ceph.conf is consistent
with monitors in the ceph cluster during scaleback operations.

Change-Id: I2159dd32a49e4591494881bab8469f087a539d5a
Closes-Bug: 1888768
This commit is contained in:
James Page 2020-07-24 10:52:17 +01:00
parent c0f003ae0c
commit 78e7b57854
2 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1 @@
glance_relations.py

View File

@ -346,7 +346,15 @@ def ceph_changed():
send_request_if_needed(get_ceph_request())
@hooks.hook('ceph-relation-departed')
@restart_on_change(restart_map())
def ceph_departed():
resolve_CONFIGS()
CONFIGS.write_all()
@hooks.hook('ceph-relation-broken')
@restart_on_change(restart_map())
def ceph_broken():
resolve_CONFIGS()
service = service_name()