From 78e7b57854fc1d9a1ddefd55f4c92e62b718ad63 Mon Sep 17 00:00:00 2001 From: James Page Date: Fri, 24 Jul 2020 10:52:17 +0100 Subject: [PATCH] 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 --- hooks/ceph-relation-departed | 1 + hooks/glance_relations.py | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 120000 hooks/ceph-relation-departed diff --git a/hooks/ceph-relation-departed b/hooks/ceph-relation-departed new file mode 120000 index 00000000..e955ca43 --- /dev/null +++ b/hooks/ceph-relation-departed @@ -0,0 +1 @@ +glance_relations.py \ No newline at end of file diff --git a/hooks/glance_relations.py b/hooks/glance_relations.py index 7a0c900a..d86abbee 100755 --- a/hooks/glance_relations.py +++ b/hooks/glance_relations.py @@ -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()