Py3: Fix encoding in _verify_topics method
Change-Id: I0f75ca4505acfd7840cde7d76174bd8a32354880
This commit is contained in:
parent
572ba3a54f
commit
3ed5838fc1
@ -16,6 +16,7 @@ import collections
|
||||
|
||||
from monasca_common.kafka_lib import client
|
||||
from oslo_log import log
|
||||
from six import PY3
|
||||
|
||||
from monasca_log_api import conf
|
||||
|
||||
@ -72,6 +73,9 @@ class KafkaHealthCheck(object):
|
||||
def _verify_topics(self, kafka_client):
|
||||
topics = CONF.kafka_healthcheck.kafka_topics
|
||||
|
||||
if PY3:
|
||||
topics = tuple(topic.encode('utf-8') for topic in topics)
|
||||
|
||||
for t in topics:
|
||||
# kafka client loads metadata for topics as fast
|
||||
# as possible (happens in __init__), therefore this
|
||||
|
Loading…
Reference in New Issue
Block a user