Remove unused db.api.floating_ip_set_auto_assigned
Change-Id: I5a2be6dd733a4bc092e4658d8010cc3a5eb0d6a3
This commit is contained in:
parent
4c45902548
commit
cf40253758
|
@ -388,11 +388,6 @@ def floating_ip_update(context, address, values):
|
|||
return IMPL.floating_ip_update(context, address, values)
|
||||
|
||||
|
||||
def floating_ip_set_auto_assigned(context, address):
|
||||
"""Set auto_assigned flag to floating ip."""
|
||||
return IMPL.floating_ip_set_auto_assigned(context, address)
|
||||
|
||||
|
||||
def dnsdomain_list(context):
|
||||
"""Get a list of all zones in our database, public and private."""
|
||||
return IMPL.dnsdomain_list(context)
|
||||
|
|
|
@ -933,13 +933,6 @@ def floating_ip_disassociate(context, address):
|
|||
return fixed_ip_ref
|
||||
|
||||
|
||||
@require_context
|
||||
def floating_ip_set_auto_assigned(context, address):
|
||||
model_query(context, models.FloatingIp).\
|
||||
filter_by(address=address).\
|
||||
update({'auto_assigned': True})
|
||||
|
||||
|
||||
def _floating_ip_get_all(context, session=None):
|
||||
return model_query(context, models.FloatingIp, read_deleted="no",
|
||||
session=session)
|
||||
|
|
|
@ -166,13 +166,6 @@ def fake_floating_ip_get_by_address(context, address):
|
|||
return FakeModel(ips[0])
|
||||
|
||||
|
||||
def fake_floating_ip_set_auto_assigned(contex, address):
|
||||
ips = filter(lambda i: i['address'] == address,
|
||||
floating_ips)
|
||||
if ips:
|
||||
ips[0]['auto_assigned'] = True
|
||||
|
||||
|
||||
def fake_fixed_ip_associate(context, address, instance_id):
|
||||
ips = filter(lambda i: i['address'] == address,
|
||||
fixed_ips)
|
||||
|
@ -338,7 +331,6 @@ def stub_out_db_network_api(stubs):
|
|||
fake_floating_ip_fixed_ip_associate,
|
||||
fake_floating_ip_get_all_by_host,
|
||||
fake_floating_ip_get_by_address,
|
||||
fake_floating_ip_set_auto_assigned,
|
||||
fake_fixed_ip_associate,
|
||||
fake_fixed_ip_associate_pool,
|
||||
fake_fixed_ip_create,
|
||||
|
|
|
@ -4133,21 +4133,6 @@ class FloatingIpTestCase(test.TestCase, ModelsObjectComparatorMixin):
|
|||
db.floating_ip_disassociate, self.ctxt,
|
||||
'11.11.11.11')
|
||||
|
||||
def test_floating_ip_set_auto_assigned(self):
|
||||
addresses = ['1.1.1.1', '1.1.1.2', '1.1.1.3']
|
||||
float_ips = [self._create_floating_ip({'address': addr,
|
||||
'auto_assigned': False})
|
||||
for addr in addresses]
|
||||
|
||||
for i in range(2):
|
||||
db.floating_ip_set_auto_assigned(self.ctxt, float_ips[i].address)
|
||||
for i in range(2):
|
||||
float_ip = db.floating_ip_get(self.ctxt, float_ips[i].id)
|
||||
self.assertTrue(float_ip.auto_assigned)
|
||||
|
||||
float_ip = db.floating_ip_get(self.ctxt, float_ips[2].id)
|
||||
self.assertFalse(float_ip.auto_assigned)
|
||||
|
||||
def test_floating_ip_get_all(self):
|
||||
addresses = ['1.1.1.1', '1.1.1.2', '1.1.1.3']
|
||||
float_ips = [self._create_floating_ip({'address': addr})
|
||||
|
|
Loading…
Reference in New Issue