Browse Source

Merge "BCF-13378: fix floating ip syncing issue in p-only mode" into stable/queens

tags/12.0.14^0
Zuul 2 months ago
committed by Gerrit Code Review
parent
commit
29c0672852
3 changed files with 16 additions and 20 deletions
  1. +13
    -12
      networking_bigswitch/plugins/bigswitch/plugin.py
  2. +1
    -3
      networking_bigswitch/plugins/bigswitch/servermanager.py
  3. +2
    -5
      networking_bigswitch/plugins/ml2/drivers/mech_bigswitch/driver.py

+ 13
- 12
networking_bigswitch/plugins/bigswitch/plugin.py View File

@@ -232,7 +232,7 @@ class NeutronRestProxyV2Base(db_base_plugin_v2.NeutronDbPluginV2,
return self._get_all_data(
get_floating_ips=self.l3_bsn_plugin,
get_routers=self.l3_bsn_plugin,
get_sgs=True)
get_sgs=cfg.CONF.RESTPROXY.sync_security_groups)

def _get_all_data(self, get_ports=True, get_floating_ips=True,
get_routers=True, get_sgs=True):
@@ -265,10 +265,11 @@ class NeutronRestProxyV2Base(db_base_plugin_v2.NeutronDbPluginV2,
new_subnets.append(subnet)
mapped_network['subnets'] = new_subnets

flips_n_ports = mapped_network
if get_floating_ips:
flips_n_ports = self._get_network_with_floatingips(
mapped_network)
else:
flips_n_ports = mapped_network

if get_ports:
ports = []
@@ -300,7 +301,7 @@ class NeutronRestProxyV2Base(db_base_plugin_v2.NeutronDbPluginV2,
'mac': port.get('mac_address'),
}

if not cfg.CONF.RESTPROXY.sync_security_groups:
if not get_sgs:
if 'security_groups' in mapped_port:
del mapped_port['security_groups']

@@ -376,8 +377,7 @@ class NeutronRestProxyV2Base(db_base_plugin_v2.NeutronDbPluginV2,
# L3 plugin also includes tenant policies
# data.update({'policies': tenant_policies})

if (get_sgs and self.l3_plugin
and cfg.CONF.RESTPROXY.sync_security_groups):
if get_sgs and self.l3_plugin:
sgs = plugin.get_security_groups(admin_context) or []
new_sgs = []
for sg in sgs:
@@ -639,8 +639,13 @@ class NeutronRestProxyV2Base(db_base_plugin_v2.NeutronDbPluginV2,
# display-name is also mapped here
mapped_network = self._get_mapped_network_with_subnets(network,
context)
net_fl_ips = self._get_network_with_floatingips(mapped_network,
context)

if self.l3_bsn_plugin:
net_fl_ips = self._get_network_with_floatingips(mapped_network,
context)
else:
net_fl_ips = mapped_network

if not tenant_id:
tenant_id = servermanager.SERVICE_TENANT
net_fl_ips['tenant_id'] = servermanager.SERVICE_TENANT
@@ -1023,11 +1028,7 @@ class NeutronRestProxyV2(NeutronRestProxyV2Base,

# init network ctrl connections
self.servers = servermanager.ServerPool()
self.servers.get_topo_function = self._get_all_data
self.servers.get_topo_function_args = {'get_ports': True,
'get_floating_ips': True,
'get_routers': True,
'get_sgs': True}
self.servers.get_topo_function = self._get_all_data_auto

self.network_scheduler = importutils.import_object(
cfg.CONF.network_scheduler_driver


+ 1
- 3
networking_bigswitch/plugins/bigswitch/servermanager.py View File

@@ -527,7 +527,6 @@ class ServerPool(object):
# Function to use to retrieve topology for consistency syncs.
# Needs to be set by module that uses the servermanager.
self.get_topo_function = None
self.get_topo_function_args = {}

if not servers:
raise cfg.Error(_('Servers not defined. Aborting server manager.'))
@@ -1181,8 +1180,7 @@ class ServerPool(object):
"%(start_ts)s",
{'request_ts': cdb.convert_ts_to_datetime(curr_ts),
'start_ts': cdb.convert_ts_to_datetime(time.time())})
data = self.get_topo_function(
**self.get_topo_function_args)
data = self.get_topo_function()
if not data:
# when keystone sync fails, it fails silently with data = None
# that is wrong, we need to raise an exception


+ 2
- 5
networking_bigswitch/plugins/ml2/drivers/mech_bigswitch/driver.py View File

@@ -73,11 +73,8 @@ class BigSwitchMechanismDriver(plugin.NeutronRestProxyV2Base,

# init network ctrl connections
self.servers = servermanager.ServerPool()
self.servers.get_topo_function = self._get_all_data
self.servers.get_topo_function_args = {'get_ports': True,
'get_floating_ips': True,
'get_routers': True,
'get_sgs': True}
self.servers.get_topo_function = self._get_all_data_auto

# perform one forced topo_sync after 60secs. delayed to let plugin
# initialization complete
eventlet.spawn_after(60, self.servers.force_topo_sync,


Loading…
Cancel
Save