From 7d064697c7f95981788e2f6bbb354b6258e2c4e1 Mon Sep 17 00:00:00 2001 From: Adam Gandelman Date: Tue, 20 Aug 2013 12:10:36 -0700 Subject: [PATCH] Add generic relation broken hook. --- hooks/amqp-relation-broken | 1 + hooks/ceph-relation-broken | 1 + hooks/cloud-compute-relation-broken | 1 + hooks/image-service-relation-broken | 1 + hooks/nova_compute_hooks.py | 10 ++++++++++ hooks/shared-db-relation-broken | 1 + 6 files changed, 15 insertions(+) create mode 120000 hooks/amqp-relation-broken create mode 120000 hooks/ceph-relation-broken create mode 120000 hooks/cloud-compute-relation-broken create mode 120000 hooks/image-service-relation-broken create mode 120000 hooks/shared-db-relation-broken diff --git a/hooks/amqp-relation-broken b/hooks/amqp-relation-broken new file mode 120000 index 00000000..3ba0bdea --- /dev/null +++ b/hooks/amqp-relation-broken @@ -0,0 +1 @@ +nova_compute_hooks.py \ No newline at end of file diff --git a/hooks/ceph-relation-broken b/hooks/ceph-relation-broken new file mode 120000 index 00000000..3ba0bdea --- /dev/null +++ b/hooks/ceph-relation-broken @@ -0,0 +1 @@ +nova_compute_hooks.py \ No newline at end of file diff --git a/hooks/cloud-compute-relation-broken b/hooks/cloud-compute-relation-broken new file mode 120000 index 00000000..3ba0bdea --- /dev/null +++ b/hooks/cloud-compute-relation-broken @@ -0,0 +1 @@ +nova_compute_hooks.py \ No newline at end of file diff --git a/hooks/image-service-relation-broken b/hooks/image-service-relation-broken new file mode 120000 index 00000000..3ba0bdea --- /dev/null +++ b/hooks/image-service-relation-broken @@ -0,0 +1 @@ +nova_compute_hooks.py \ No newline at end of file diff --git a/hooks/nova_compute_hooks.py b/hooks/nova_compute_hooks.py index 6ba64b19..052605b3 100755 --- a/hooks/nova_compute_hooks.py +++ b/hooks/nova_compute_hooks.py @@ -177,6 +177,16 @@ def ceph_changed(): CONFIGS.write('/etc/nova/nova.conf') +@hooks.hook('amqp-relation-broken', + 'ceph-relation-broken', + 'cloud-compute-relation-broken', + 'image-service-relation-broken', + 'shared-db-relation-broken') +@restart_on_change(restart_map()) +def relation_broken(): + CONFIGS.write_all() + + def main(): try: hooks.execute(sys.argv) diff --git a/hooks/shared-db-relation-broken b/hooks/shared-db-relation-broken new file mode 120000 index 00000000..3ba0bdea --- /dev/null +++ b/hooks/shared-db-relation-broken @@ -0,0 +1 @@ +nova_compute_hooks.py \ No newline at end of file