Sfoglia il codice sorgente

OSP-290: Delete security_groups from port if security-group-sync is disabled

Currently security-group for endpoint is a hidden field on CLI, it
only affects test-path, and that's why we did not notice the issue.

Change-Id: I7e06fd0954eb2029859561567fe2b6593625dbb2
tags/12.0.13^0
Weifan Fu 7 mesi fa
parent
commit
2c6d1578fe
2 ha cambiato i file con 15 aggiunte e 0 eliminazioni
  1. +6
    -0
      networking_bigswitch/plugins/bigswitch/plugin.py
  2. +9
    -0
      networking_bigswitch/plugins/bigswitch/servermanager.py

+ 6
- 0
networking_bigswitch/plugins/bigswitch/plugin.py Vedi File

@@ -299,7 +299,13 @@ class NeutronRestProxyV2Base(db_base_plugin_v2.NeutronDbPluginV2,
'id': port.get('device_id'),
'mac': port.get('mac_address'),
}

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

ports.append(mapped_port)

flips_n_ports['ports'] = ports

if flips_n_ports:


+ 9
- 0
networking_bigswitch/plugins/bigswitch/servermanager.py Vedi File

@@ -1008,6 +1008,13 @@ class ServerPool(object):

def rest_create_port(self, tenant_id, net_id, port):
resource = ATTACHMENT_PATH % (tenant_id, net_id, port["id"])

# security-group info might be useful for some higher level
# operations, so we modify the json right before sending
if not cfg.CONF.RESTPROXY.sync_security_groups:
if 'security_groups' in port:
del port['security_groups']

data = {"port": port}
device_id = port.get("device_id")
if not port["mac_address"] or not device_id:
@@ -1018,7 +1025,9 @@ class ServerPool(object):
return
data["attachment"] = {"id": device_id,
"mac": port["mac_address"]}

errstr = _("Unable to create remote port: %s")

self.rest_action('PUT', resource, data, errstr)

def rest_delete_port(self, tenant_id, network_id, port_id):


Loading…
Annulla
Salva