Remove default_{host,port} deprecated options
The Kafka driver deprecated the kafka_default_host and kafka_default_port options in 5.10.0, released in Ocata. Remove them. Change-Id: I206e68ec1624bb6d5d6ba320572530352bbd4378
This commit is contained in:
parent
90a5bd5077
commit
4cc1264a18
@ -144,14 +144,7 @@ class Connection(object):
|
|||||||
LOG.warning(_LW("Different transport usernames detected"))
|
LOG.warning(_LW("Different transport usernames detected"))
|
||||||
|
|
||||||
if host.hostname:
|
if host.hostname:
|
||||||
self.hostaddrs.append("%s:%s" % (
|
self.hostaddrs.append("%s:%s" % (host.hostname, host.port))
|
||||||
host.hostname,
|
|
||||||
host.port or self.driver_conf.kafka_default_port))
|
|
||||||
|
|
||||||
if not self.hostaddrs:
|
|
||||||
self.hostaddrs.append("%s:%s" %
|
|
||||||
(self.driver_conf.kafka_default_host,
|
|
||||||
self.driver_conf.kafka_default_port))
|
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
"""Reset a connection so it can be used again."""
|
"""Reset a connection so it can be used again."""
|
||||||
|
@ -16,16 +16,6 @@ from oslo_config import cfg
|
|||||||
from oslo_messaging._drivers import common
|
from oslo_messaging._drivers import common
|
||||||
|
|
||||||
KAFKA_OPTS = [
|
KAFKA_OPTS = [
|
||||||
cfg.StrOpt('kafka_default_host', default='localhost',
|
|
||||||
deprecated_for_removal=True,
|
|
||||||
deprecated_reason="Replaced by [DEFAULT]/transport_url",
|
|
||||||
help='Default Kafka broker Host'),
|
|
||||||
|
|
||||||
cfg.PortOpt('kafka_default_port', default=9092,
|
|
||||||
deprecated_for_removal=True,
|
|
||||||
deprecated_reason="Replaced by [DEFAULT]/transport_url",
|
|
||||||
help='Default Kafka broker Port'),
|
|
||||||
|
|
||||||
cfg.IntOpt('kafka_max_fetch_bytes', default=1024 * 1024,
|
cfg.IntOpt('kafka_max_fetch_bytes', default=1024 * 1024,
|
||||||
help='Max fetch bytes of Kafka consumer'),
|
help='Max fetch bytes of Kafka consumer'),
|
||||||
|
|
||||||
|
@ -37,21 +37,6 @@ class TestKafkaDriverLoad(test_utils.BaseTestCase):
|
|||||||
class TestKafkaTransportURL(test_utils.BaseTestCase):
|
class TestKafkaTransportURL(test_utils.BaseTestCase):
|
||||||
|
|
||||||
scenarios = [
|
scenarios = [
|
||||||
('none', dict(url=None,
|
|
||||||
expected=dict(hostaddrs=['localhost:9092'],
|
|
||||||
username=None,
|
|
||||||
password=None,
|
|
||||||
vhost=''))),
|
|
||||||
('empty', dict(url='kafka:///',
|
|
||||||
expected=dict(hostaddrs=['localhost:9092'],
|
|
||||||
username=None,
|
|
||||||
password=None,
|
|
||||||
vhost=''))),
|
|
||||||
('host', dict(url='kafka://127.0.0.1',
|
|
||||||
expected=dict(hostaddrs=['127.0.0.1:9092'],
|
|
||||||
username=None,
|
|
||||||
password=None,
|
|
||||||
vhost=None))),
|
|
||||||
('port', dict(url='kafka://localhost:1234',
|
('port', dict(url='kafka://localhost:1234',
|
||||||
expected=dict(hostaddrs=['localhost:1234'],
|
expected=dict(hostaddrs=['localhost:1234'],
|
||||||
username=None,
|
username=None,
|
||||||
@ -141,7 +126,7 @@ class TestKafkaDriver(test_utils.BaseTestCase):
|
|||||||
consumer.assert_called_once_with(
|
consumer.assert_called_once_with(
|
||||||
*expected_topics, group_id="kafka_test",
|
*expected_topics, group_id="kafka_test",
|
||||||
enable_auto_commit=mock.ANY,
|
enable_auto_commit=mock.ANY,
|
||||||
bootstrap_servers=['localhost:9092'],
|
bootstrap_servers=[],
|
||||||
max_partition_fetch_bytes=mock.ANY,
|
max_partition_fetch_bytes=mock.ANY,
|
||||||
max_poll_records=mock.ANY,
|
max_poll_records=mock.ANY,
|
||||||
security_protocol='PLAINTEXT',
|
security_protocol='PLAINTEXT',
|
||||||
|
Loading…
Reference in New Issue
Block a user