Comment 15 for bug 1273636

Revision history for this message
Stuart Bishop (stub) wrote :

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

   [... do yo thang ...]