agent: notify primary agent when hobo registers secondary services (#34970)

This commit is contained in:
Frédéric Péters 2019-07-19 17:58:12 +02:00 committed by Thomas NOEL
parent 83ee68e26a
commit a5f0dac3a5
1 changed files with 6 additions and 0 deletions

View File

@ -4,6 +4,7 @@ from django.utils.timezone import now
from tenant_schemas.utils import tenant_context
from hobo.agent.common.management.commands import hobo_deploy
from hobo.deploy.signals import notify_agents
from hobo.environment.models import AVAILABLE_SERVICES, Hobo, Variable
from hobo.multitenant.middleware import TenantMiddleware, TenantNotFound
@ -95,3 +96,8 @@ class Command(hobo_deploy.Command):
name='ou-slug', auto=True, service_pk=None)
variable.value = me['slug']
variable.save()
if me.get('secondary'):
# on the primary hobo, notify other primary services, this will
# get authentic to know about secondary services
notify_agents(None)