NSX|V3: Fix bug in checking lbaas port dev-owner

Fix bug in checking for using allowed-address-pairs
on a LBAAS port

Change-Id: Ie4f80c3bea7c9e4779b979e41cbb8530ce91803c
Signed-off-by: Michal Kelner Mishali <mkelnermishal@vmware.com>
This commit is contained in:
Michal Kelner Mishali 2018-09-13 12:02:38 +03:00
parent 8f39db15b8
commit a0bef7a6de
1 changed files with 2 additions and 1 deletions

View File

@ -482,7 +482,8 @@ class NsxPluginBase(db_base_plugin_v2.NeutronDbPluginV2,
"""Prevent illegal device owner modifications
"""
if orig_dev_own == constants.DEVICE_OWNER_LOADBALANCERV2:
if port_data['allowed_address_pairs']:
if ("allowed_address_pairs" in port_data and
port_data["allowed_address_pairs"]):
msg = _('Loadbalancer port can not be updated '
'with address pairs')
raise n_exc.InvalidInput(error_message=msg)