Unset DB init flag on shared-db relation removal
The keystone charm sets db-initialised to true after initializing the database the first time. However, if the database application is removed, this flag is not unset. This results in breakage on attempts to re-add a shared-db relation with a new database application, as the charm will not attempt to re-initialize the database prior to doing DB operations. This fix simply ensures that we unset this flag prior to finalizing removal of the shared-db relation. Change-Id: I78ae12fda05ce006939b2d90a3d738bacb815915 Closes-Bug: #1797229
This commit is contained in:
parent
2dca259156
commit
a87b101106
@ -50,6 +50,7 @@ from charmhelpers.core.hookenv import (
|
||||
open_port,
|
||||
is_leader,
|
||||
relation_id,
|
||||
leader_set,
|
||||
)
|
||||
|
||||
from charmhelpers.core.host import (
|
||||
@ -393,6 +394,13 @@ def db_changed():
|
||||
update_all_identity_relation_units()
|
||||
|
||||
|
||||
@hooks.hook('shared-db-relation-departed',
|
||||
'shared-db-relation-broken')
|
||||
def db_departed_or_broken():
|
||||
if is_leader():
|
||||
leader_set({'db-initialised': None})
|
||||
|
||||
|
||||
@hooks.hook('identity-service-relation-changed')
|
||||
@restart_on_change(restart_map(), restart_functions=restart_function_map())
|
||||
def identity_changed(relation_id=None, remote_unit=None):
|
||||
|
1
hooks/shared-db-relation-broken
Symbolic link
1
hooks/shared-db-relation-broken
Symbolic link
@ -0,0 +1 @@
|
||||
keystone_hooks.py
|
1
hooks/shared-db-relation-departed
Symbolic link
1
hooks/shared-db-relation-departed
Symbolic link
@ -0,0 +1 @@
|
||||
keystone_hooks.py
|
Loading…
Reference in New Issue
Block a user