Add assess_status() to base layer as part of workload status

This bakes in the assess_status() to the update-status hook to call
assess_status() on the charms_openstack.charm.OpenStackCharm class.

This has the effect of determining the workload status for the
unit.

Change-Id: Idf9a712f818445ba9f68dccae2d98237eb7f7eee
This commit is contained in:
Alex Kavanagh 2016-07-15 14:55:20 +00:00
parent eb2f28539e
commit 9b87aae38a
1 changed files with 22 additions and 0 deletions

View File

@ -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()