diff options
Diffstat (limited to 'kafka/conn.py')
-rw-r--r-- | kafka/conn.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kafka/conn.py b/kafka/conn.py index de2d385..20f22dc 100644 --- a/kafka/conn.py +++ b/kafka/conn.py @@ -17,8 +17,11 @@ def collect_hosts(hosts, randomize=True): randomize the returned list. """ + if isinstance(hosts, str): + hosts = hosts.split(',') + result = [] - for host_port in hosts.split(","): + for host_port in hosts: res = host_port.split(':') host = res[0] |