Browse Source

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

changes/08/672208/1
Zuul 2 months ago
parent
commit
0e56475ef4
2 changed files with 7 additions and 0 deletions
  1. 5
    0
      vmware_nsx/db/nsxv_db.py
  2. 2
    0
      vmware_nsx/plugins/nsx_v/plugin.py

+ 5
- 0
vmware_nsx/db/nsxv_db.py View File

@@ -684,6 +684,11 @@ def get_nsxv_spoofguard_policy_network_mappings(session, filters=None,
684 684
                filters, like_filters).all()
685 685
 
686 686
 
687
+def del_nsxv_spoofguard_binding(session, policy_id):
688
+    return (session.query(nsxv_models.NsxvSpoofGuardPolicyNetworkMapping).
689
+            filter_by(policy_id=policy_id).delete())
690
+
691
+
687 692
 def add_nsxv_lbaas_loadbalancer_binding(
688 693
         session, loadbalancer_id, edge_id, edge_fw_rule_id, vip_address):
689 694
     with session.begin(subtransactions=True):

+ 2
- 0
vmware_nsx/plugins/nsx_v/plugin.py View File

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

Loading…
Cancel
Save