projects
/
osm
/
devops.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add ability to specify downstream stage
[osm/devops.git]
/
juju-charms
/
layers
/
pingpong
/
reactive
/
pingpong.py
diff --git
a/juju-charms/layers/pingpong/reactive/pingpong.py
b/juju-charms/layers/pingpong/reactive/pingpong.py
index
2bcbc14
..
ae18076
100755
(executable)
--- a/
juju-charms/layers/pingpong/reactive/pingpong.py
+++ b/
juju-charms/layers/pingpong/reactive/pingpong.py
@@
-23,16
+23,29
@@
import charms.sshproxy
cfg = config()
cfg = config()
+@when_not('pingpong.configured')
+def not_configured():
+ """Check the current configuration.
+
+ Check the current values in config to see if we have enough
+ information to continue.
+ """
+ config_changed()
+
+
@when('config.changed', 'sshproxy.configured')
def config_changed():
"""Verify the configuration.
@when('config.changed', 'sshproxy.configured')
def config_changed():
"""Verify the configuration.
+
Verify that the charm has been configured
"""
Verify that the charm has been configured
"""
+ status_set('maintenance', 'Verifying configuration data...')
(validated, output) = charms.sshproxy.verify_ssh_credentials()
if not validated:
status_set('blocked', 'Unable to verify SSH credentials: {}'.format(
output
))
(validated, output) = charms.sshproxy.verify_ssh_credentials()
if not validated:
status_set('blocked', 'Unable to verify SSH credentials: {}'.format(
output
))
+ return
if all(k in cfg for k in ['mode']):
if cfg['mode'] in ['ping', 'pong']:
set_flag('pingpong.configured')
if all(k in cfg for k in ['mode']):
if cfg['mode'] in ['ping', 'pong']:
set_flag('pingpong.configured')