I think everything will work as it should if the client checks that relation_get('database') matches the expected database name before proceeding. This is additional burden on the client, but I don't think it can be avoided.
@hook()
def db_relation_changed():
if local_unit() not in relation_get('allowed-units').split():
return # Unit not yet authorized
if config('database') !- relation_get('database'):
return # Database name change not yet in effect
I think everything will work as it should if the client checks that relation_ get('database' ) matches the expected database name before proceeding. This is additional burden on the client, but I don't think it can be avoided.
@hook() changed( ): get('allowed- units') .split( ): get('database' ):
def db_relation_
if local_unit() not in relation_
return # Unit not yet authorized
if config('database') !- relation_
return # Database name change not yet in effect
[... do yo thang ...]