From bfda016be4ca18fa7bfe74d9c2827068899b9487 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Fri, 11 Jan 2019 13:58:00 +0000 Subject: [PATCH] Add default handler for storage-backend Add a default handler for storage-backend relation. This is part of the work to push cinder plugin bolierplate code into supporting layers. Change-Id: Icad5f72939b1e33d15adf2638f8e344235a9318b --- reactive/layer_openstack.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reactive/layer_openstack.py b/reactive/layer_openstack.py index 8ed6cfb..21f0220 100644 --- a/reactive/layer_openstack.py +++ b/reactive/layer_openstack.py @@ -66,6 +66,13 @@ def run_default_update_status(): reactive.remove_state('run-default-update-status') +@reactive.when('storage-backend.connected', + 'charms.openstack.do-default-storage-backend.connected') +def run_storage_backend(): + with charm.provide_charm_instance() as instance: + instance.send_storage_backend_data() + + # Series upgrade hooks are a special case and reacting to the hook directly # makes sense as we may not want other charm code to run @reactive.hook('pre-series-upgrade')