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,11 +3006,18 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
|
||||||
seg_subnets = self._get_segment_subnets(
|
seg_subnets = self._get_segment_subnets(
|
||||||
context, network_id, interface_subnets=net_rtr_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
|
# Remove the tier1 connectivity of this segment
|
||||||
# This must be done is a separate call as it uses PUT
|
# This must be done is a separate call as it uses PUT
|
||||||
self.nsxpolicy.segment.remove_connectivity_and_subnets(
|
self.nsxpolicy.segment.remove_connectivity_and_subnets(
|
||||||
segment_id)
|
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
|
# update remaining (DHCP/ipv4/6) subnets
|
||||||
if seg_subnets:
|
if seg_subnets:
|
||||||
|
|
Loading…
Reference in New Issue