Merge "NSX|V: ensure port security is enabled for address pair support"

This commit is contained in:
Zuul 2018-01-15 07:51:44 +00:00 committed by Gerrit Code Review
commit b12e6a414b

View File

@ -2111,6 +2111,12 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
'and no other attributes for port %s') %
original_port['id'])
raise n_exc.BadRequest(resource='port', msg=msg)
# Address pairs require port security
if (not has_port_security and
(original_port[addr_apidef.ADDRESS_PAIRS] or
addr_apidef.ADDRESS_PAIRS in attrs)):
msg = _('Address pairs require port security enabled')
raise n_exc.BadRequest(resource='port', msg=msg)
# TODO(roeyc): create a method '_process_vnic_index_update' from the
# following code block