From 7a057278f91c12818a9829ff33765e6bc1008228 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Tue, 6 Oct 2015 11:18:53 +0200 Subject: [PATCH 09/10] agent/common: does not send notifications when in a FakeTenant (#8425) It breaks initial role migrations and new tenants deploy. --- hobo/agent/common/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hobo/agent/common/__init__.py b/hobo/agent/common/__init__.py index 5b50cc6..bee1307 100644 --- a/hobo/agent/common/__init__.py +++ b/hobo/agent/common/__init__.py @@ -7,8 +7,12 @@ from django.db import connection def notify_agents(data): '''Send notifications to all other tenants''' + tenant = connection.get_tenant() + if not hasattr(tenant, 'domain_url'): + # Fake tenant, certainly during migration, do nothing + return notification = { - 'tenant': connection.get_tenant().domain_url, + 'tenant': tenant.domain_url, 'data': data, } with Celery('hobo', broker=settings.BROKER_URL) as app: -- 2.1.4