From e83891c18331373ece99d229167c7f9c5574cf82 Mon Sep 17 00:00:00 2001 From: asarfaty Date: Thu, 26 Dec 2019 11:45:51 +0200 Subject: [PATCH] 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 --- vmware_nsx/plugins/common_v3/plugin.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vmware_nsx/plugins/common_v3/plugin.py b/vmware_nsx/plugins/common_v3/plugin.py index 8a16f8ed6a..066a17eb6f 100644 --- a/vmware_nsx/plugins/common_v3/plugin.py +++ b/vmware_nsx/plugins/common_v3/plugin.py @@ -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: