Ensure we can recover from error during db init
Currently if a failure occurs during the shared-db hook intialisation sequence after db is inited but before admin creds have been setup, there is no way to re-run ensure_admin_credentials. This patch resolves that issue. Change-Id: Iad80a0eeae6f94dc89ff994f8e5794c60c272e16 Closes-Bug: 1578351
This commit is contained in:
parent
ce7949805f
commit
216a5c9e39
|
@ -322,6 +322,7 @@ def leader_init_db_if_ready(use_current_context=False):
|
|||
|
||||
if is_db_initialised():
|
||||
log("Database already initialised - skipping db init", level=DEBUG)
|
||||
update_all_identity_relation_units(check_db_ready=False)
|
||||
return
|
||||
|
||||
# Bugs 1353135 & 1187508. Dbs can appear to be ready before the
|
||||
|
|
|
@ -957,7 +957,7 @@ class KeystoneRelationTests(CharmTestCase):
|
|||
self.log.assert_called_with('Database already initialised - skipping '
|
||||
'db init', level='DEBUG')
|
||||
self.assertFalse(self.migrate_database.called)
|
||||
self.assertFalse(update.called)
|
||||
self.assertTrue(update.called)
|
||||
|
||||
@patch.object(hooks, 'update_all_identity_relation_units')
|
||||
@patch.object(hooks, 'is_db_initialised')
|
||||
|
|
Loading…
Reference in New Issue