Skip to content

Commit

Permalink
Fix fixed_ip_count_by_project in DB API
Browse files Browse the repository at this point in the history
Fix "by project" filtering in fixed_ip_count_by_project
method of SQLAlchemy DB API implementation.

Fixes: bug #1171161
Change-Id: Id408aba6db4dd953945feba36d17b056266ca4b7
  • Loading branch information
Spikhalskiy committed Apr 22, 2013
1 parent 9899003 commit 101b80e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion nova/db/sqlalchemy/api.py
Expand Up @@ -1266,7 +1266,7 @@ def fixed_ip_count_by_project(context, project_id, session=None):
session=session).\
join((models.Instance,
models.Instance.uuid == models.FixedIp.instance_uuid)).\
filter(models.Instance.uuid == project_id).\
filter(models.Instance.project_id == project_id).\
count()


Expand Down
2 changes: 0 additions & 2 deletions nova/tests/test_db_api.py
Expand Up @@ -2443,7 +2443,6 @@ def test_fixed_ips_by_virtual_interface_no_ip_found(self):
ips_list = db.fixed_ips_by_virtual_interface(self.ctxt, vif.id)
self.assertEquals(0, len(ips_list))

@test.testtools.skip("bug #1171161")
def test_fixed_ip_count_by_project_one_ip(self):
PROJECT_ID = "project_id"
instance_uuid = self._create_instance(PROJECT_ID)
Expand All @@ -2453,7 +2452,6 @@ def test_fixed_ip_count_by_project_one_ip(self):
ips_count = db.fixed_ip_count_by_project(self.ctxt, PROJECT_ID)
self.assertEquals(1, ips_count)

@test.testtools.skip("bug #1171161")
def test_fixed_ip_count_by_project_two_ips_for_different_instances(self):
PROJECT_ID = "project_id"
instance_uuid = self._create_instance(PROJECT_ID)
Expand Down

0 comments on commit 101b80e

Please sign in to comment.