NSX: Restrict enable-dhcp on update external subnet

Adding restriction for enabling dhcp on updating external subnet

Change-Id: I4ae085eaac5461c637edb43888e615cf7bc97ccb
Signed-off-by: Michal Kelner Mishali <mkelnermishal@vmware.com>
This commit is contained in:
Michal Kelner Mishali 2019-05-19 10:39:00 +03:00 committed by Adit Sarfaty
parent d753ec6945
commit c567af4497
2 changed files with 2 additions and 0 deletions

View File

@ -2179,6 +2179,7 @@ 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'],

View File

@ -3015,6 +3015,7 @@ 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'])
self._validate_host_routes_input(subnet,
orig_enable_dhcp=enable_dhcp,
orig_host_routes=orig_host_routes)