From c7564d239795f9d20f5a027f32130ee1ae84ab3e Mon Sep 17 00:00:00 2001 From: Dana Powers Date: Mon, 25 Apr 2016 13:39:07 -0700 Subject: Allow setting host interface in KafkaFixture.instance --- test/fixtures.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/fixtures.py b/test/fixtures.py index 654e636..b8d6fc3 100644 --- a/test/fixtures.py +++ b/test/fixtures.py @@ -182,7 +182,8 @@ class ZookeeperFixture(Fixture): class KafkaFixture(Fixture): @classmethod - def instance(cls, broker_id, zk_host, zk_port, zk_chroot=None, port=None, + def instance(cls, broker_id, zk_host, zk_port, zk_chroot=None, + host=None, port=None, transport='PLAINTEXT', replicas=1, partitions=2): if zk_chroot is None: zk_chroot = "kafka-python_" + str(uuid.uuid4()).replace("-", "_") @@ -207,7 +208,8 @@ class KafkaFixture(Fixture): # # Note that even though we specify the bind host in bracket notation, Kafka responds to the bootstrap # metadata request without square brackets later. - host = "[::1]" + if host is None: + host = "[::1]" fixture = KafkaFixture(host, port, broker_id, zk_host, zk_port, zk_chroot, transport=transport, -- cgit v1.2.1