Merge "NSX|V: Bug fixing for allowed address_pairs" into stable/queens

This commit is contained in:
Zuul 2019-07-15 13:09:59 +00:00 committed by Gerrit Code Review
commit 0e56475ef4
2 changed files with 7 additions and 0 deletions

View File

@ -684,6 +684,11 @@ def get_nsxv_spoofguard_policy_network_mappings(session, filters=None,
filters, like_filters).all() filters, like_filters).all()
def del_nsxv_spoofguard_binding(session, policy_id):
return (session.query(nsxv_models.NsxvSpoofGuardPolicyNetworkMapping).
filter_by(policy_id=policy_id).delete())
def add_nsxv_lbaas_loadbalancer_binding( def add_nsxv_lbaas_loadbalancer_binding(
session, loadbalancer_id, edge_id, edge_fw_rule_id, vip_address): session, loadbalancer_id, edge_id, edge_fw_rule_id, vip_address):
with session.begin(subtransactions=True): with session.begin(subtransactions=True):

View File

@ -1696,6 +1696,8 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
if sg_policy: if sg_policy:
try: try:
self.nsx_v.vcns.delete_spoofguard_policy(sg_policy) self.nsx_v.vcns.delete_spoofguard_policy(sg_policy)
nsxv_db.del_nsxv_spoofguard_binding(context.session,
sg_policy)
except Exception as e: except Exception as e:
LOG.error('Unable to delete spoofguard policy ' LOG.error('Unable to delete spoofguard policy '
'%(sg_policy)s. Error: %(e)s', '%(sg_policy)s. Error: %(e)s',