NSX|P: Create/delete tier1 locale-service upon router create/delete
The NSX backend needs each logical router to have a locale-service entry, which should also be deleted before the router is deleted. Change-Id: If64c1b67c19906105b07c6facedf5d07ac36176d
This commit is contained in:
parent
533965a55f
commit
93ea6d76d2
@ -174,7 +174,7 @@ class NSXClient(object):
|
||||
# remove all nat rules from this router before deletion
|
||||
self.cleanup_tier1_nat_rules(rtr['id'])
|
||||
try:
|
||||
self.nsxpolicy.tier1.remove_edge_cluster(rtr['id'])
|
||||
self.nsxpolicy.tier1.delete_locale_service(rtr['id'])
|
||||
except exceptions.ManagerError as e:
|
||||
# Not always exists
|
||||
pass
|
||||
|
@ -1640,6 +1640,9 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
|
||||
router_name, router['id'],
|
||||
tier0=None,
|
||||
tags=tags)
|
||||
# Also create the empty locale-service as it must always exist
|
||||
self.nsxpolicy.tier1.create_locale_service(router['id'])
|
||||
|
||||
#TODO(annak): narrow down the exception
|
||||
except Exception as ex:
|
||||
with excutils.save_and_reraise_exception():
|
||||
@ -1672,6 +1675,7 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
|
||||
context, router_id)
|
||||
|
||||
try:
|
||||
self.nsxpolicy.tier1.delete_locale_service(router_id)
|
||||
self.nsxpolicy.tier1.delete(router_id)
|
||||
except nsx_lib_exc.ResourceNotFound:
|
||||
# If the resource was not found on the backend do not worry about
|
||||
|
Loading…
Reference in New Issue
Block a user