Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Example reactive charm to test register_trigger
from charms.reactive import when, when_not, set_flag
from charmhelpers.core.hookenv import log, config
from charms.reactive.flags import register_trigger
# Register a trigger so that we can respond to config.changed, even if
# it's being cleared by another handler
def install_test_config_changed():
def log_config_changed():
cfg = config()
log("#### config-changed state handled: {}".format(cfg))
def trigger_config_changed():
cfg = config()
log("#### trigger_config_changed called: {}".format(cfg))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.