Browse Source

Merge "NSX|P: Fix devstack cleanup for fwaas" into stable/ussuri

changes/09/779609/1
Zuul 2 months ago
committed by Gerrit Code Review
parent
commit
22e1ee20db
2 changed files with 14 additions and 3 deletions
  1. +11
    -3
      devstack/tools/nsxp_cleanup.py
  2. +3
    -0
      vmware_nsx/services/fwaas/nsx_p/fwaas_callbacks_v2.py

+ 11
- 3
devstack/tools/nsxp_cleanup.py View File

@ -517,14 +517,22 @@ class NSXClient(object):
tags_to_search,
self.nsxpolicy.group.entry_def.resource_type())['results']
for group in groups:
self.nsxpolicy.group.delete(policy_constants.DEFAULT_DOMAIN,
group['id'])
try:
self.nsxpolicy.group.delete(
policy_constants.DEFAULT_DOMAIN, group['id'])
except exceptions.ResourceInUse:
# This may happen if the rule is used in multiple gateways
pass
services = self.nsxpolicy.search_by_tags(
tags_to_search,
self.nsxpolicy.service.parent_entry_def.resource_type())
for srv in services['results']:
self.nsxpolicy.service.delete(srv['id'])
try:
self.nsxpolicy.service.delete(srv['id'])
except exceptions.ResourceInUse:
# This may happen if the rule is used in multiple gateways
pass
def get_os_qos_policies(self):
policies = self.get_os_resources(self.nsxpolicy.qos_profile.list())


+ 3
- 0
vmware_nsx/services/fwaas/nsx_p/fwaas_callbacks_v2.py View File

@ -452,6 +452,9 @@ class NsxpFwaasCallbacksV2(com_callbacks.NsxCommonv3FwaasCallbacksV2):
self.cleanup_router_fw_resources(router_id)
def cleanup_router_fw_resources(self, router_id):
# TODO(asarfaty): In case multiple routers are using the same rule,
# the group and service will hold on one of the router ids. so this
# delete may fail or not get called.
tags_to_search = [{'scope': ROUTER_FW_TAG, 'tag': router_id}]
# Delete per rule & per network groups
groups = self.nsxpolicy.search_by_tags(


Loading…
Cancel
Save