Misc tidy post major changes
Restore setting of flag 'configured' once vault has had an initial configuration set. Drop @when_not('configured') as we always want to rewrite the vault configuration file - but we only restart it when its changed now! Drop handlers for etcd states - really not needed as configuration is not longer guarded with @when_not('configured'). Add missing patch for service enable call in configure function. Change-Id: Ia335c3a711cf371c42483ae86980b256a07ad21d
This commit is contained in:
parent
cb5c24366c
commit
34714a92ae
|
@ -141,8 +141,6 @@ def snap_refresh():
|
|||
|
||||
|
||||
def configure_vault(context):
|
||||
context['disable_mlock'] = config()['disable-mlock']
|
||||
context['ssl_available'] = is_state('vault.ssl.available')
|
||||
log("Running configure_vault", level=DEBUG)
|
||||
context['disable_mlock'] = config()['disable-mlock']
|
||||
context['ssl_available'] = is_state('vault.ssl.available')
|
||||
|
@ -179,10 +177,10 @@ def configure_vault(context):
|
|||
service('enable', 'vault')
|
||||
log("Opening vault port", level=DEBUG)
|
||||
open_port(8200)
|
||||
set_flag('configured')
|
||||
|
||||
|
||||
@when('snap.installed.vault')
|
||||
@when_not('configured')
|
||||
@when('db.master.available')
|
||||
@when('vault.schema.created')
|
||||
@when('vault.ssl.configured')
|
||||
|
@ -195,7 +193,6 @@ def configure_vault_psql(psql):
|
|||
|
||||
|
||||
@when('snap.installed.vault')
|
||||
@when_not('configured')
|
||||
@when('shared-db.available')
|
||||
@when('vault.ssl.configured')
|
||||
def configure_vault_mysql(mysql):
|
||||
|
@ -307,24 +304,6 @@ def ssl_ca_changed():
|
|||
remove_state('vault.ssl.configured')
|
||||
|
||||
|
||||
@when_not('etcd.local.configured')
|
||||
@when('etcd.available')
|
||||
def etcd_setup(etcd):
|
||||
log("Detected etcd.available, removing configured", level=DEBUG)
|
||||
remove_state('configured')
|
||||
remove_state('etcd.local.unconfigured')
|
||||
set_state('etcd.local.configured')
|
||||
|
||||
|
||||
@when_not('etcd.local.unconfigured')
|
||||
@when_not('etcd.available')
|
||||
def etcd_not_ready():
|
||||
log("Detected etcd_not_ready, removing configured", level=DEBUG)
|
||||
set_state('etcd.local.unconfigured')
|
||||
remove_state('etcd.local.configured')
|
||||
remove_state('configured')
|
||||
|
||||
|
||||
@when('configured')
|
||||
@when('nrpe-external-master.available')
|
||||
@when_not('vault.nrpe.configured')
|
||||
|
|
|
@ -58,6 +58,7 @@ class TestHandlers(unit_tests.test_utils.CharmTestCase):
|
|||
'open_port',
|
||||
'service_restart',
|
||||
'service_running',
|
||||
'service',
|
||||
'set_state',
|
||||
'status_set',
|
||||
'remove_state',
|
||||
|
|
Loading…
Reference in New Issue