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
This commit is contained in:
Roey Chen 2015-11-02 02:37:53 -08:00 committed by garyk
parent 3073d6debb
commit 43e68fd07b
1 changed files with 3 additions and 7 deletions

View File

@ -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