From 89142dbc8125c8e912a79cf2673814229711c0e0 Mon Sep 17 00:00:00 2001 From: Sachin Bansal Date: Mon, 5 Oct 2015 11:49:01 -0700 Subject: [PATCH] Do not return no-rule SG to neutron When neutron creates a port with no SG specified, we assign an internal SG called '__no_rule__'. This should not be returned to neutron when the port is read. Change-Id: I91125f46db227b5f10acc26fd74e4556476431ee Closes-Bug: 1476503 (cherry picked from commit d11ab28ad8b38f95dc9bfba8dc3f65283ea085b4) (cherry picked from commit 37b5769de20a1c5c65d931134833d9b7a1476c17) --- .../vnc_openstack/vnc_openstack/neutron_plugin_db.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py b/src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py index dac29f86871..6184d7f2f9d 100644 --- a/src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py +++ b/src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py @@ -2006,10 +2006,9 @@ def _port_vnc_to_neutron(self, port_obj, port_req_memo=None): port_q_dict['fixed_ips'].append(ip_q_dict) - port_q_dict['security_groups'] = [] - sg_refs = port_obj.get_security_group_refs() - for sg_ref in sg_refs or []: - port_q_dict['security_groups'].append(sg_ref['uuid']) + sg_refs = port_obj.get_security_group_refs() or [] + port_q_dict['security_groups'] = [ref['uuid'] for ref in sg_refs + if ref['to'] != SG_NO_RULE_FQ_NAME] port_q_dict['admin_state_up'] = port_obj.get_id_perms().enable