Commit b2f472d6 authored by Samuel GAIST's avatar Samuel GAIST

[utils][management][commands][broker] Fix name handling

The callbacks receive the name of the worker as bytes,
convert them to string in order to be able to properly
filter the database content.
parent e61af2f5
Pipeline #43141 passed with stage
in 15 minutes and 26 seconds
......@@ -30,6 +30,7 @@ import logging
from django.core.management.base import BaseCommand
from django.db import transaction
from django.utils.encoding import force_str
from beat.core.bcpapi.broker import BeatComputationBroker
from beat.core.utils import setup_logging
......@@ -41,6 +42,7 @@ logger = logging.getLogger(__name__)
def onWorkerReady(name):
name = force_str(name)
logger.info("Worker '%s' is ready", name)
try:
worker = Worker.objects.get(name=name)
......@@ -57,6 +59,7 @@ def onWorkerReady(name):
def onWorkerGone(name):
name = force_str(name)
logger.info("Worker '%s' is gone", name)
try:
worker = Worker.objects.get(name=name)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment