From 88e59cd5e0cc7745cb8d5fa90d0ba3bea6048ef2 Mon Sep 17 00:00:00 2001 From: schillinge Date: Tue, 19 Mar 2019 21:24:27 +0100 Subject: [PATCH] Fixed setting kafka's advertised IP Shortly before pushing the latest API I did some refactoring. During that I unfortunately broke this. The advertised IP has to be without subnet mask. So we remove it here if one was existing. Change-Id: I37f9df376d0c899b4911b23302dacb9922122f0f Signed-off-by: schillinge --- src/emuvim/api/osm/kafka.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/emuvim/api/osm/kafka.py b/src/emuvim/api/osm/kafka.py index 4443621..c5f643f 100644 --- a/src/emuvim/api/osm/kafka.py +++ b/src/emuvim/api/osm/kafka.py @@ -21,9 +21,11 @@ from emuvim.api.util.process_utils import wait_until class Kafka(OSMComponentBase): def __init__(self, net, ip, zookeeper_ip, version='latest', name_prefix=''): OSMComponentBase.__init__(self) + subnet_separator_index = ip.find('/') + ip_without_subnet = ip if subnet_separator_index == -1 else ip[:subnet_separator_index] self.instance = net.addDocker( '{}kafka'.format(name_prefix), ip=ip, dimage='wurstmeister/kafka:%s' % version, - environment={'KAFKA_ADVERTISED_HOST_NAME': ip, + environment={'KAFKA_ADVERTISED_HOST_NAME': ip_without_subnet, 'KAFKA_ADVERTISED_PORT': '9092', 'KAFKA_ZOOKEEPER_CONNECT': '%s:2181' % zookeeper_ip, 'KAFKA_CREATE_TOPICS': 'admin:1:1,ns:1:1,vim_account:1:1,wim_account:1:1,sdn:1:1,nsi:1:1' -- 2.17.1