VMware: fix security group check on port create
The code did not consider an empty list among the cases in which security groups are not supplied on port create. Change-Id: I6e4ac3dee0d02c6c26977f8e2fee717587b8bfc5 Closes-Bug: #1405311
This commit is contained in:
parent
3a96a43c53
commit
eb52e853c4
@ -1122,9 +1122,12 @@ class NsxPluginV2(addr_pair_db.AllowedAddressPairsMixin,
|
|||||||
port_data[addr_pair.ADDRESS_PAIRS] = []
|
port_data[addr_pair.ADDRESS_PAIRS] = []
|
||||||
|
|
||||||
# security group extension checks
|
# security group extension checks
|
||||||
|
# NOTE: check_update_has_security_groups works fine for
|
||||||
|
# create operations as well
|
||||||
if port_security and has_ip:
|
if port_security and has_ip:
|
||||||
self._ensure_default_security_group_on_port(context, port)
|
self._ensure_default_security_group_on_port(context, port)
|
||||||
elif attr.is_attr_set(port_data.get(ext_sg.SECURITYGROUPS)):
|
elif self._check_update_has_security_groups(
|
||||||
|
{'port': port_data}):
|
||||||
raise psec.PortSecurityAndIPRequiredForSecurityGroups()
|
raise psec.PortSecurityAndIPRequiredForSecurityGroups()
|
||||||
port_data[ext_sg.SECURITYGROUPS] = (
|
port_data[ext_sg.SECURITYGROUPS] = (
|
||||||
self._get_security_groups_on_port(context, port))
|
self._get_security_groups_on_port(context, port))
|
||||||
|
Loading…
Reference in New Issue
Block a user