def router_added_to_agent(self, context, router_ids, host):
self._notification_host(context, 'router_added_to_agent',
router_ids, host)
-
-L3AgentNotify = L3AgentNotifyAPI()
class L3_NAT_db_mixin(l3.RouterPluginBase):
"""Mixin class to add L3/NAT router methods to db_base_plugin_v2."""
- l3_rpc_notifier = l3_rpc_agent_api.L3AgentNotify
router_device_owners = (
DEVICE_OWNER_ROUTER_INTF,
DEVICE_OWNER_ROUTER_GW,
DEVICE_OWNER_FLOATINGIP
)
+ @property
+ def l3_rpc_notifier(self):
+ if not hasattr(self, '_l3_rpc_notifier'):
+ self._l3_rpc_notifier = l3_rpc_agent_api.L3AgentNotifyAPI()
+ return self._l3_rpc_notifier
+
+ @l3_rpc_notifier.setter
+ def l3_rpc_notifier(self, value):
+ self._l3_rpc_notifier = value
+
@property
def _core_plugin(self):
return manager.NeutronManager.get_plugin()
dhcp_rpc_agent_api.DhcpAgentNotifyAPI()
)
self.agent_notifiers[q_const.AGENT_TYPE_L3] = (
- l3_rpc_agent_api.L3AgentNotify
+ l3_rpc_agent_api.L3AgentNotifyAPI()
)
def create_network(self, context, network):
for svc_topic in self.service_topics.values():
self.conn.create_consumer(svc_topic, self.dispatcher, fanout=False)
self.dhcp_agent_notifier = dhcp_rpc_agent_api.DhcpAgentNotifyAPI()
- self.l3_agent_notifier = l3_rpc_agent_api.L3AgentNotify
+ self.l3_agent_notifier = l3_rpc_agent_api.L3AgentNotifyAPI()
# Consume from all consumers in a thread
self.conn.consume_in_thread()
dhcp_rpc_agent_api.DhcpAgentNotifyAPI()
)
self.agent_notifiers[q_const.AGENT_TYPE_L3] = (
- l3_rpc_agent_api.L3AgentNotify
+ l3_rpc_agent_api.L3AgentNotifyAPI()
)
def _parse_network_vlan_ranges(self):
class L2populationMechanismDriver(api.MechanismDriver,
l2pop_db.L2populationDbMixin):
+ def __init__(self):
+ super(L2populationMechanismDriver, self).__init__()
+ self.L2populationAgentNotify = l2pop_rpc.L2populationAgentNotifyAPI()
+
def initialize(self):
LOG.debug(_("Experimental L2 population driver"))
self.rpc_ctx = n_context.get_admin_context_without_session()
def delete_port_postcommit(self, context):
fanout_msg = self.deleted_ports.pop(context.current['id'], None)
if fanout_msg:
- l2pop_rpc.L2populationAgentNotify.remove_fdb_entries(
+ self.L2populationAgentNotify.remove_fdb_entries(
self.rpc_ctx, fanout_msg)
def _get_diff_ips(self, orig, port):
if port_mac_ip:
ports['after'] = port_mac_ip
- l2pop_rpc.L2populationAgentNotify.update_fdb_entries(
+ self.L2populationAgentNotify.update_fdb_entries(
self.rpc_ctx, {'chg_ip': upd_fdb_entries})
return True
self._update_port_up(context)
elif port['status'] == const.PORT_STATUS_DOWN:
fdb_entries = self._update_port_down(context, port)
- l2pop_rpc.L2populationAgentNotify.remove_fdb_entries(
+ self.L2populationAgentNotify.remove_fdb_entries(
self.rpc_ctx, fdb_entries)
elif port['status'] == const.PORT_STATUS_BUILD:
orig = self.migrated_ports.pop(port['id'], None)
if orig:
# this port has been migrated : remove its entries from fdb
fdb_entries = self._update_port_down(context, orig)
- l2pop_rpc.L2populationAgentNotify.remove_fdb_entries(
+ self.L2populationAgentNotify.remove_fdb_entries(
self.rpc_ctx, fdb_entries)
def _get_port_infos(self, context, port):
const.FLOODING_ENTRY)
if ports.keys():
- l2pop_rpc.L2populationAgentNotify.add_fdb_entries(
+ self.L2populationAgentNotify.add_fdb_entries(
self.rpc_ctx, agent_fdb_entries, agent_host)
# Notify other agents to add fdb rule for current port
other_fdb_entries[network_id]['ports'][agent_ip] += port_fdb_entries
- l2pop_rpc.L2populationAgentNotify.add_fdb_entries(self.rpc_ctx,
- other_fdb_entries)
+ self.L2populationAgentNotify.add_fdb_entries(self.rpc_ctx,
+ other_fdb_entries)
def _update_port_down(self, context, port_context,
agent_active_ports_count_for_flooding=0):
else:
self._notification_fanout(context, 'update_fdb_entries',
fdb_entries)
-
-L2populationAgentNotify = L2populationAgentNotifyAPI()
dhcp_rpc_agent_api.DhcpAgentNotifyAPI()
)
self.agent_notifiers[q_const.AGENT_TYPE_L3] = (
- l3_rpc_agent_api.L3AgentNotify
+ l3_rpc_agent_api.L3AgentNotifyAPI()
)
def _parse_network_config(self):
dhcp_rpc_agent_api.DhcpAgentNotifyAPI()
)
self.agent_notifiers[q_const.AGENT_TYPE_L3] = (
- l3_rpc_agent_api.L3AgentNotify
+ l3_rpc_agent_api.L3AgentNotifyAPI()
)
self.callbacks = NVSDPluginRpcCallbacks()
self.dispatcher = self.callbacks.create_rpc_dispatcher()
dhcp_rpc_agent_api.DhcpAgentNotifyAPI()
)
self.agent_notifiers[q_const.AGENT_TYPE_L3] = (
- l3_rpc_agent_api.L3AgentNotify
+ l3_rpc_agent_api.L3AgentNotifyAPI()
)
self.callbacks = OVSRpcCallbacks(self.notifier, self.tunnel_type)
self.dispatcher = self.callbacks.create_rpc_dispatcher()
self.topic = topics.L3PLUGIN
self.conn = rpc_compat.create_connection(new=True)
self.agent_notifiers.update(
- {q_const.AGENT_TYPE_L3: l3_rpc_agent_api.L3AgentNotify})
+ {q_const.AGENT_TYPE_L3: l3_rpc_agent_api.L3AgentNotifyAPI()})
self.callbacks = L3RouterPluginRpcCallbacks()
self.dispatcher = self.callbacks.create_rpc_dispatcher()
self.conn.create_consumer(self.topic, self.dispatcher,