From 1423eb66b1081c9c89cdaf163fa5106cb5766abc Mon Sep 17 00:00:00 2001 From: Adam Israel Date: Mon, 6 Nov 2017 17:19:02 -0500 Subject: [PATCH] Stop checking config if ssh verification fails If the ssh verification fails, don't continue checking the config. This could potentially lead to a condition where the charm thinks it's ready when it's not. Signed-off-by: Adam Israel --- juju-charms/layers/pingpong/reactive/pingpong.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/juju-charms/layers/pingpong/reactive/pingpong.py b/juju-charms/layers/pingpong/reactive/pingpong.py index 701d9e21..ae18076c 100755 --- a/juju-charms/layers/pingpong/reactive/pingpong.py +++ b/juju-charms/layers/pingpong/reactive/pingpong.py @@ -26,14 +26,17 @@ 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.""" + information to continue. + """ config_changed() @when('config.changed', 'sshproxy.configured') def config_changed(): """Verify the configuration. + Verify that the charm has been configured """ status_set('maintenance', 'Verifying configuration data...') @@ -42,6 +45,7 @@ def config_changed(): 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') -- 2.25.1