[kafka] invoke TypeError exception when 'listen()' method of KafkaDriver

is called

The interface of BaseDriver which is a super-class of each underlying
transport driver has been changed.
But the interface of kafka driver doens't follow up this change. So if a
user chose it as a transport driver, an exception of TypeError would be
occurred.
This change corrects the interface in kafka's driver along with the
BaseDriver's one.

Change-Id: Iedd069b7f083e2cbf377f4148411f77ad758f979
Closes-Bug: #1616755
This commit is contained in:
Hiroyasu.OHYAMA 2016-08-29 11:24:51 +09:00
parent 661b12604f
commit 204dfa7d84
2 changed files with 3 additions and 2 deletions

View File

@ -347,7 +347,7 @@ class KafkaDriver(base.BaseDriver):
with self._get_connection(purpose=PURPOSE_SEND) as conn:
conn.notify_send(target_to_topic(target), ctxt, message, retry)
def listen(self, target):
def listen(self, target, batch_size, batch_timeout):
raise NotImplementedError(
'The RPC implementation for Kafka is not implemented')

View File

@ -108,7 +108,8 @@ class TestKafkaDriver(test_utils.BaseTestCase):
def test_listen(self):
target = oslo_messaging.Target(topic="topic_test")
self.assertRaises(NotImplementedError, self.driver.listen, target)
self.assertRaises(NotImplementedError, self.driver.listen, target,
None, None)
class TestKafkaConnection(test_utils.BaseTestCase):