From cf3410b6c07d2fc352f98e5fc1eea16d86a5e1a8 Mon Sep 17 00:00:00 2001 From: Brian Haley Date: Mon, 12 Aug 2019 12:39:35 -0400 Subject: [PATCH] Move factory assignment in _ipam_allocate_ips() It was inside a for loop, but should be outside since it's a static assignment. Trivialfix Change-Id: I6385ec91b9df3c53175c5be17857a0402d7c4f4e --- neutron/db/ipam_pluggable_backend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neutron/db/ipam_pluggable_backend.py b/neutron/db/ipam_pluggable_backend.py index ef6cc4d5823..bc65e7c542a 100644 --- a/neutron/db/ipam_pluggable_backend.py +++ b/neutron/db/ipam_pluggable_backend.py @@ -118,6 +118,7 @@ class IpamPluggableBackend(ipam_backend_mixin.IpamBackendMixin): allocated ip addresses. """ allocated = [] + factory = ipam_driver.get_address_request_factory() # we need to start with entries that asked for a specific IP in case # those IPs happen to be next in the line for allocation for ones that @@ -132,7 +133,6 @@ class IpamPluggableBackend(ipam_backend_mixin.IpamBackendMixin): ip_list = [ip] if isinstance(ip, dict) else ip subnets = [ip_dict['subnet_id'] for ip_dict in ip_list] try: - factory = ipam_driver.get_address_request_factory() ip_request = factory.get_request(context, port, ip_list[0]) ipam_allocator = ipam_driver.get_allocator(subnets) ip_address, subnet_id = ipam_allocator.allocate(ip_request)