NSX|P: Fix router interface removal
With Policy DHCP, subnets should not allways be removed from the segment. Change-Id: I80344e506e225b13838bc06999dbc72930414c68
This commit is contained in:
parent
e74509dea8
commit
e567073dfb
@ -3006,16 +3006,23 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
|
||||
seg_subnets = self._get_segment_subnets(
|
||||
context, network_id, interface_subnets=net_rtr_subnets)
|
||||
|
||||
if not net_rtr_subnets:
|
||||
if not net_rtr_subnets and not seg_subnets:
|
||||
# Remove the tier1 connectivity of this segment
|
||||
# This must be done is a separate call as it uses PUT
|
||||
self.nsxpolicy.segment.remove_connectivity_and_subnets(
|
||||
segment_id)
|
||||
else:
|
||||
#TODO(asarfaty): Try to combine the 2 backend calls
|
||||
if not net_rtr_subnets:
|
||||
# Remove connectivity path
|
||||
# This must be done is a separate call as it uses PUT
|
||||
self.nsxpolicy.segment.remove_connectivity_path(
|
||||
segment_id)
|
||||
|
||||
# update remaining (DHCP/ipv4/6) subnets
|
||||
if seg_subnets:
|
||||
self.nsxpolicy.segment.update(segment_id,
|
||||
subnets=seg_subnets)
|
||||
# update remaining (DHCP/ipv4/6) subnets
|
||||
if seg_subnets:
|
||||
self.nsxpolicy.segment.update(segment_id,
|
||||
subnets=seg_subnets)
|
||||
|
||||
# will update the router only if needed
|
||||
self._update_slaac_on_router(context, router_id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user