NSX-V: Fail only if DHCP enabled when updating external subnet

The current logic is forbidding all sort of updates on subnets
associated with external networks.

Change-Id: I89f3ef821534f26b820790b48ba385889498ff46
This commit is contained in:
Salvatore Orlando 2021-06-16 01:13:44 -07:00
parent 1244f4770f
commit 283275751c
1 changed files with 2 additions and 1 deletions

View File

@ -3044,7 +3044,8 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
gateway_ip = orig['gateway_ip']
enable_dhcp = orig['enable_dhcp']
orig_host_routes = orig['routes']
self._validate_external_subnet(context, orig['network_id'])
if s.get('enable_dhcp'):
self._validate_external_subnet(context, orig['network_id'])
self._validate_host_routes_input(subnet,
orig_enable_dhcp=enable_dhcp,
orig_host_routes=orig_host_routes)