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'