Make pgsql_db_joined callable outside context

This commit is contained in:
James Page 2014-03-31 14:05:15 +01:00
parent 2acf85568d
commit 7743e781e9

View File

@ -111,14 +111,15 @@ def db_joined(relation_id=None):
@hooks.hook('pgsql-db-relation-joined')
def pgsql_db_joined():
def pgsql_db_joined(relation_id=None):
if is_relation_made('shared-db'):
# raise error
e = ('Attempting to associate a postgresql database when there is already '
'associated a mysql one')
log(e, level=ERROR)
raise Exception(e)
relation_set(database=config('database'))
relation_set(database=config('database'),
relation_id=relation_id)
@hooks.hook('amqp-relation-joined')