Merge "Enable DHCP agent to work with plugin when L2 agents use DB polling"
This commit is contained in:
commit
d15151d42a
@ -156,9 +156,8 @@ class LinuxBridgePluginV2(db_base_plugin_v2.QuantumDbPluginV2):
|
|||||||
db.initialize()
|
db.initialize()
|
||||||
self._parse_network_vlan_ranges()
|
self._parse_network_vlan_ranges()
|
||||||
db.sync_network_states(self.network_vlan_ranges)
|
db.sync_network_states(self.network_vlan_ranges)
|
||||||
self.rpc = cfg.CONF.AGENT.rpc
|
self.agent_rpc = cfg.CONF.AGENT.rpc
|
||||||
if self.rpc:
|
self._setup_rpc()
|
||||||
self._setup_rpc()
|
|
||||||
LOG.debug("Linux Bridge Plugin initialization complete")
|
LOG.debug("Linux Bridge Plugin initialization complete")
|
||||||
|
|
||||||
def _setup_rpc(self):
|
def _setup_rpc(self):
|
||||||
@ -326,7 +325,7 @@ class LinuxBridgePluginV2(db_base_plugin_v2.QuantumDbPluginV2):
|
|||||||
binding.vlan_id, self.network_vlan_ranges)
|
binding.vlan_id, self.network_vlan_ranges)
|
||||||
# the network_binding record is deleted via cascade from
|
# the network_binding record is deleted via cascade from
|
||||||
# the network record, so explicit removal is not necessary
|
# the network record, so explicit removal is not necessary
|
||||||
if self.rpc:
|
if self.agent_rpc:
|
||||||
self.notifier.network_delete(self.rpc_context, id)
|
self.notifier.network_delete(self.rpc_context, id)
|
||||||
|
|
||||||
def get_network(self, context, id, fields=None, verbose=None):
|
def get_network(self, context, id, fields=None, verbose=None):
|
||||||
@ -344,11 +343,11 @@ class LinuxBridgePluginV2(db_base_plugin_v2.QuantumDbPluginV2):
|
|||||||
return [self._fields(net, fields) for net in nets]
|
return [self._fields(net, fields) for net in nets]
|
||||||
|
|
||||||
def update_port(self, context, id, port):
|
def update_port(self, context, id, port):
|
||||||
if self.rpc:
|
if self.agent_rpc:
|
||||||
original_port = super(LinuxBridgePluginV2, self).get_port(context,
|
original_port = super(LinuxBridgePluginV2, self).get_port(context,
|
||||||
id)
|
id)
|
||||||
port = super(LinuxBridgePluginV2, self).update_port(context, id, port)
|
port = super(LinuxBridgePluginV2, self).update_port(context, id, port)
|
||||||
if self.rpc:
|
if self.agent_rpc:
|
||||||
if original_port['admin_state_up'] != port['admin_state_up']:
|
if original_port['admin_state_up'] != port['admin_state_up']:
|
||||||
binding = db.get_network_binding(context.session,
|
binding = db.get_network_binding(context.session,
|
||||||
port['network_id'])
|
port['network_id'])
|
||||||
|
@ -197,9 +197,8 @@ class OVSQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2,
|
|||||||
|
|
||||||
# update the vlan_id table based on current configuration
|
# update the vlan_id table based on current configuration
|
||||||
ovs_db_v2.update_vlan_id_pool()
|
ovs_db_v2.update_vlan_id_pool()
|
||||||
self.rpc = cfg.CONF.AGENT.rpc
|
self.agent_rpc = cfg.CONF.AGENT.rpc
|
||||||
if cfg.CONF.AGENT.rpc:
|
self.setup_rpc()
|
||||||
self.setup_rpc()
|
|
||||||
|
|
||||||
def setup_rpc(self):
|
def setup_rpc(self):
|
||||||
# RPC support
|
# RPC support
|
||||||
@ -335,7 +334,7 @@ class OVSQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2,
|
|||||||
vlan_id = ovs_db_v2.get_vlan(id)
|
vlan_id = ovs_db_v2.get_vlan(id)
|
||||||
result = super(OVSQuantumPluginV2, self).delete_network(context, id)
|
result = super(OVSQuantumPluginV2, self).delete_network(context, id)
|
||||||
ovs_db_v2.release_vlan_id(vlan_id)
|
ovs_db_v2.release_vlan_id(vlan_id)
|
||||||
if self.rpc:
|
if self.agent_rpc:
|
||||||
self.notifier.network_delete(self.context, id)
|
self.notifier.network_delete(self.context, id)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@ -354,11 +353,11 @@ class OVSQuantumPluginV2(db_base_plugin_v2.QuantumDbPluginV2,
|
|||||||
return [self._fields(net, fields) for net in nets]
|
return [self._fields(net, fields) for net in nets]
|
||||||
|
|
||||||
def update_port(self, context, id, port):
|
def update_port(self, context, id, port):
|
||||||
if self.rpc:
|
if self.agent_pc:
|
||||||
original_port = super(OVSQuantumPluginV2, self).get_port(context,
|
original_port = super(OVSQuantumPluginV2, self).get_port(context,
|
||||||
id)
|
id)
|
||||||
port = super(OVSQuantumPluginV2, self).update_port(context, id, port)
|
port = super(OVSQuantumPluginV2, self).update_port(context, id, port)
|
||||||
if self.rpc:
|
if self.agent_rpc:
|
||||||
if original_port['admin_state_up'] != port['admin_state_up']:
|
if original_port['admin_state_up'] != port['admin_state_up']:
|
||||||
vlan_id = ovs_db_v2.get_vlan(port['network_id'])
|
vlan_id = ovs_db_v2.get_vlan(port['network_id'])
|
||||||
self.notifier.port_update(self.context, port, vlan_id)
|
self.notifier.port_update(self.context, port, vlan_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user