diff --git a/reactive/charms_openstack_handlers.py b/reactive/charms_openstack_handlers.py new file mode 100644 index 0000000..66f7a66 --- /dev/null +++ b/reactive/charms_openstack_handlers.py @@ -0,0 +1,22 @@ +# handle the update-status hook for all openstack charms + +from __future__ import absolute_import + +import charms.reactive as reactive +import charmhelpers.core.hookenv as hookenv + +import charms_openstack.charm as charm + + +@reactive.hook('update-status') +def update_status(): + """Use the update-status hook to run the assess_status() function for the + unit. + + This runs, via the singleton, the assess_status() on the derived class, + which is auto-instantiated according the the release. + + To deactivate this function override the assess_status in the derived class + to a NOP. + """ + charm.OpenStackCharm.singleton.assess_status()