Merge "Adding bulk create fixed ips. The true issue here is the creation of IPs in the DB that are not currently used(we are building the entire block). This fix is just a bandaid, but it does cut ~25 seconds off of the quantum tests on my laptop."
This commit is contained in:
commit
ee71c91250
@ -357,6 +357,11 @@ def fixed_ip_create(context, values):
|
||||
return IMPL.fixed_ip_create(context, values)
|
||||
|
||||
|
||||
def fixed_ip_bulk_create(context, ips):
|
||||
"""Create a lot of fixed ips from the values dictionary."""
|
||||
return IMPL.fixed_ip_bulk_create(context, ips)
|
||||
|
||||
|
||||
def fixed_ip_disassociate(context, address):
|
||||
"""Disassociate a fixed ip from an instance by address."""
|
||||
return IMPL.fixed_ip_disassociate(context, address)
|
||||
|
@ -767,6 +767,16 @@ def fixed_ip_create(_context, values):
|
||||
return fixed_ip_ref['address']
|
||||
|
||||
|
||||
@require_context
|
||||
def fixed_ip_bulk_create(_context, ips):
|
||||
session = get_session()
|
||||
with session.begin():
|
||||
for ip in ips:
|
||||
model = models.FixedIp()
|
||||
model.update(ip)
|
||||
session.add(model)
|
||||
|
||||
|
||||
@require_context
|
||||
def fixed_ip_disassociate(context, address):
|
||||
session = get_session()
|
||||
|
Loading…
x
Reference in New Issue
Block a user