Merge "Sinkhole workaround for old topics"

This commit is contained in:
Jenkins 2017-08-04 02:36:58 +00:00 committed by Gerrit Code Review
commit 9d616f075c

View File

@ -288,6 +288,7 @@ class OVSNeutronAgent(l2population_rpc.L2populationRpcCallBackTunnelMixin,
# The initialization is complete; we can start receiving messages
self.connection.consume_in_threads()
self.dead_topics.consume_in_threads()
self.quitting_rpc_timeout = agent_conf.quitting_rpc_timeout
@ -379,6 +380,27 @@ class OVSNeutronAgent(l2population_rpc.L2populationRpcCallBackTunnelMixin,
topics.AGENT,
consumers,
start_listening=False)
self.setup_old_topic_sinkhole()
def setup_old_topic_sinkhole(self):
class SinkHole(object):
def __getattr__(self, attr):
return self._receiver
def _receiver(self, *args, **kwargs):
pass
# TODO(kevinbenton): remove this once oslo.messaging solves
# bug/1705351 so we can stop subscribing to these old topics
old_consumers = [[topics.PORT, topics.UPDATE],
[topics.PORT, topics.DELETE],
[topics.SECURITY_GROUP, topics.UPDATE],
[topics.NETWORK, topics.UPDATE]]
self._sinkhole = SinkHole()
self.dead_topics = agent_rpc.create_consumers(
[self._sinkhole], topics.AGENT, old_consumers,
start_listening=False
)
def init_extension_manager(self, connection):
ext_manager.register_opts(self.conf)