NSX|V3+P: Allow external subnet updates

It is forbidden to enable dhcp on an external subnet, but other
updates should be allowed.

Change-Id: I9f1f77cbcba7e02e1ed1b76eb29de308b145f944
This commit is contained in:
asarfaty 2019-12-26 11:45:51 +02:00 committed by Adit Sarfaty
parent 632d9d39fd
commit 1e19e85693
1 changed files with 2 additions and 1 deletions

View File

@ -2332,7 +2332,6 @@ class NsxPluginV3Base(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
updated_subnet = None
orig_subnet = self.get_subnet(context, subnet_id)
self._validate_number_of_subnet_static_routes(subnet)
self._validate_external_subnet(context, orig_subnet['network_id'])
self._validate_host_routes_input(
subnet,
orig_enable_dhcp=orig_subnet['enable_dhcp'],
@ -2350,6 +2349,8 @@ class NsxPluginV3Base(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
orig_enable_dhcp = self._subnet_with_native_dhcp(orig_subnet)
if enable_dhcp != orig_enable_dhcp:
self._ensure_native_dhcp()
self._validate_external_subnet(
context, orig_subnet['network_id'])
lock = 'nsxv3_network_' + orig_subnet['network_id']
with locking.LockManager.get_lock(lock):
if enable_dhcp: