def _validate_gw_out_of_pools(self, gateway_ip, pools): for allocation_pool in pools: pool_range = netaddr.IPRange(allocation_pool['start'], allocation_pool['end']) if netaddr.IPAddress(gateway_ip) in pool_range: raise n_exc.GatewayConflictWithAllocationPools( pool=pool_range, ip_address=gateway_ip)
def validate_gateway_excluded(self, gateway_ip): self._refresh_excludes() gateway_ip_addr = netaddr.IPAddress(gateway_ip) if gateway_ip_addr in self._subnet_cidr: if (not self._exclude_cidrs or (self._exclude_cidrs and gateway_ip_addr not in self._exclude_cidrs)): raise exceptions.GatewayConflictWithAllocationPools( ip_address=gateway_ip, pool=self._alloc_pools)
def validate_gw_out_of_pools(self, gateway_ip, pools): for pool_range in pools: if netaddr.IPAddress(gateway_ip) in pool_range: raise n_exc.GatewayConflictWithAllocationPools( pool=pool_range, ip_address=gateway_ip)