From 43e68fd07b5e62044bf38b56b40eeca4721fea5a Mon Sep 17 00:00:00 2001 From: Roey Chen Date: Mon, 2 Nov 2015 02:37:53 -0800 Subject: [PATCH] Fix show 'security-groups' field for port with no security-groups If port has no security-groups, then the expected value is for this field is an empty list. Change-Id: Iec0a0605ec30c56650da9dea99095430dd313292 --- vmware_nsx/plugins/nsx_v3/plugin.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/vmware_nsx/plugins/nsx_v3/plugin.py b/vmware_nsx/plugins/nsx_v3/plugin.py index a9d4fecec6..26ab3a4254 100644 --- a/vmware_nsx/plugins/nsx_v3/plugin.py +++ b/vmware_nsx/plugins/nsx_v3/plugin.py @@ -654,13 +654,9 @@ class NsxV3Plugin(addr_pair_db.AllowedAddressPairsMixin, port_data[pbin.VNIC_TYPE] = pbin.VNIC_NORMAL sgids = self._get_security_groups_on_port(context, port) - if sgids is not None: - self._process_port_create_security_group( - context, port_data, sgids) - #FIXME(abhiraut): Security group should not be processed for - # a port belonging to an external network. - # Below call will fail since there is no lport - # in the backend. + self._process_port_create_security_group( + context, port_data, sgids) + if sgids: security.update_lport_with_security_groups( context, lport['id'], [], sgids) return port_data