summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Gordon <jogo@cloudscaling.com>2013-02-19 01:14:12 +0000
committerJoe Gordon <jogo@cloudscaling.com>2013-02-25 11:00:00 -0800
commitb860fc0254cbd6dcc9906ea516271ccd5e82215f (patch)
treedfab171effc4500283e472e32b0228c8deb51a06
parent0f0a8c6bcce1b230a5719b35089f25e55a1359a8 (diff)
downloadnova-b860fc0254cbd6dcc9906ea516271ccd5e82215f.tar.gz
nova-b860fc0254cbd6dcc9906ea516271ccd5e82215f.tar.xz
nova-b860fc0254cbd6dcc9906ea516271ccd5e82215f.zip
Remove unused nova.db.api:instance_get_all_by_reservation
Change-Id: I55192773eaa18eb81ffb2b5ec3567b09116b0d1e
-rw-r--r--nova/db/api.py5
-rw-r--r--nova/db/sqlalchemy/api.py7
-rw-r--r--nova/tests/api/openstack/compute/test_servers.py18
3 files changed, 0 insertions, 30 deletions
diff --git a/nova/db/api.py b/nova/db/api.py
index d14999b45..cac96af03 100644
--- a/nova/db/api.py
+++ b/nova/db/api.py
@@ -627,11 +627,6 @@ def instance_get_all_by_host_and_not_type(context, host, type_id=None):
return IMPL.instance_get_all_by_host_and_not_type(context, host, type_id)
-def instance_get_all_by_reservation(context, reservation_id):
- """Get all instances belonging to a reservation."""
- return IMPL.instance_get_all_by_reservation(context, reservation_id)
-
-
def instance_get_floating_address(context, instance_id):
"""Get the first floating ip address of an instance."""
return IMPL.instance_get_floating_address(context, instance_id)
diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py
index 360bd1b3a..02fc0a359 100644
--- a/nova/db/sqlalchemy/api.py
+++ b/nova/db/sqlalchemy/api.py
@@ -1706,13 +1706,6 @@ def instance_get_all_by_host_and_not_type(context, host, type_id=None):
filter(models.Instance.instance_type_id != type_id).all()
-@require_context
-def instance_get_all_by_reservation(context, reservation_id):
- return _instance_get_all_query(context, project_only=True).\
- filter_by(reservation_id=reservation_id).\
- all()
-
-
# NOTE(jkoelker) This is only being left here for compat with floating
# ips. Currently the network_api doesn't return floaters
# in network_info. Once it starts return the model. This
diff --git a/nova/tests/api/openstack/compute/test_servers.py b/nova/tests/api/openstack/compute/test_servers.py
index 228d81f45..aee4fa36f 100644
--- a/nova/tests/api/openstack/compute/test_servers.py
+++ b/nova/tests/api/openstack/compute/test_servers.py
@@ -71,19 +71,10 @@ def fake_gen_uuid():
return FAKE_UUID
-def return_servers_by_reservation(context, reservation_id=""):
- return [fakes.stub_instance(i + 1,
- reservation_id=reservation_id) for i in xrange(5)]
-
-
def return_servers_empty(context, *args, **kwargs):
return []
-def return_servers_by_reservation_empty(context, reservation_id=""):
- return []
-
-
def return_security_group(context, instance_id, security_group_id):
pass
@@ -539,9 +530,6 @@ class ServersControllerTest(test.TestCase):
self.assertEqual(0, num_servers)
def test_get_server_list_with_reservation_id(self):
- self.stubs.Set(db, 'instance_get_all_by_reservation',
- return_servers_by_reservation)
-
req = fakes.HTTPRequest.blank('/v2/fake/servers?reservation_id=foo')
res_dict = self.controller.index(req)
@@ -551,9 +539,6 @@ class ServersControllerTest(test.TestCase):
i += 1
def test_get_server_list_with_reservation_id_empty(self):
- self.stubs.Set(db, 'instance_get_all_by_reservation',
- return_servers_by_reservation_empty)
-
req = fakes.HTTPRequest.blank('/v2/fake/servers/detail?'
'reservation_id=foo')
res_dict = self.controller.detail(req)
@@ -564,9 +549,6 @@ class ServersControllerTest(test.TestCase):
i += 1
def test_get_server_list_with_reservation_id_details(self):
- self.stubs.Set(db, 'instance_get_all_by_reservation',
- return_servers_by_reservation)
-
req = fakes.HTTPRequest.blank('/v2/fake/servers/detail?'
'reservation_id=foo')
res_dict = self.controller.detail(req)