NSX|P: Fix devstack cleanup for fwaas
Change-Id: Ibe21d84729785294611199a6fe900b86e8896391
This commit is contained in:
parent
79ae60c8d7
commit
c06410362f
@ -543,14 +543,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())
|
||||
|
@ -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…
x
Reference in New Issue
Block a user