)
from charms.reactive import (
+ hook,
when,
when_not,
helpers,
cfg = config()
-@when('config.changed')
+@hook('config-changed')
def validate_config():
try:
"""
If the ssh credentials are available, we'll act as a proxy charm.
Otherwise, we execute against the unit we're deployed on to.
"""
- status_set('maintenance', 'configuring ssh connection')
- remove_state('vpe.configured')
if all(k in cfg for k in ['pass', 'vpe-router', 'user']):
routerip = cfg['vpe-router']
user = cfg['user']
(' '.join(e.cmd), str(e.output)))
raise
- set_state('vpe.configured')
- status_set('active', 'ready!')
+ set_state('vpe.configured')
+ status_set('active', 'ready!')
except Exception as e:
log(repr(e))