summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Tran <jhtran@att.com>2012-05-15 10:00:36 -0700
committerJohn Tran <jhtran@att.com>2012-05-18 07:15:31 -0700
commitc1e54e1968faa23dfa26796fdb8f3f8d9ba79367 (patch)
treefa6baded773a17fd3c25ef6ffd9da7a74f760442
parent51e745fc1d9e44e04b55ecf2317df0b386d4eb05 (diff)
downloadnova-c1e54e1968faa23dfa26796fdb8f3f8d9ba79367.tar.gz
fixed_ip_get_by_address read_deleted from context
Fixes bug 996482. by default fixed_ip_get_by_address always sets read_deleted='yes'. Changed it to accept read_deleted value from context. updated .mailmap to rewrite my old email to new email Change-Id: If94251972df7bbcfdeebc226613edac0a3f41186
-rw-r--r--.mailmap1
-rw-r--r--Authors2
-rw-r--r--nova/db/sqlalchemy/api.py2
-rw-r--r--nova/tests/test_db_api.py2
4 files changed, 5 insertions, 2 deletions
diff --git a/.mailmap b/.mailmap
index 84e31bf536..66ae701dd5 100644
--- a/.mailmap
+++ b/.mailmap
@@ -79,3 +79,4 @@
<nsokolov@griddynamics.com> <nsokolov@griddynamics.net>
<troy.toman@rackspace.com> <ttcl@mac.com>
<zulcss@ubuntu.com> <chuck.short@canonical.com>
+<jhtran@att.com> <jtran@attinteractive.com>
diff --git a/Authors b/Authors
index 5c5df3d61e..88285d9711 100644
--- a/Authors
+++ b/Authors
@@ -99,7 +99,7 @@ John Dewey <john@dewey.ws>
John Garbutt <john.garbutt@citrix.com>
John Griffith <john.griffith@solidfire.com>
John Kennedy <john.m.kennedy@intel.com>
-John Tran <jtran@attinteractive.com>
+John Tran <jhtran@att.com>
Jonathan Bryce <jbryce@jbryce.com>
Jordan Rinke <jordan@openstack.org>
Joseph Suh <jsuh@isi.edu>
diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py
index 3a4e8ea1b7..c555c73c83 100644
--- a/nova/db/sqlalchemy/api.py
+++ b/nova/db/sqlalchemy/api.py
@@ -1070,7 +1070,7 @@ def fixed_ip_get_all(context, session=None):
@require_context
def fixed_ip_get_by_address(context, address, session=None):
result = model_query(context, models.FixedIp, session=session,
- read_deleted="yes").\
+ read_deleted=context.read_deleted).\
filter_by(address=address).\
first()
if not result:
diff --git a/nova/tests/test_db_api.py b/nova/tests/test_db_api.py
index c1002d98ad..1abd44a90d 100644
--- a/nova/tests/test_db_api.py
+++ b/nova/tests/test_db_api.py
@@ -151,6 +151,8 @@ class DbApiTestCase(test.TestCase):
db.network_delete_safe, ctxt, network['id'])
db.fixed_ip_update(ctxt, address2, {'allocated': False})
network = db.network_delete_safe(ctxt, network['id'])
+ self.assertRaises(exception.FixedIpNotFoundForAddress,
+ db.fixed_ip_get_by_address, ctxt, address1)
ctxt = ctxt.elevated(read_deleted='yes')
fixed_ip = db.fixed_ip_get_by_address(ctxt, address1)
self.assertTrue(fixed_ip['deleted'])