Skip to content

Commit

Permalink
fixed_ip_get_by_address read_deleted from context
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jhtran committed May 18, 2012
1 parent 51e745f commit c1e54e1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions .mailmap
Expand Up @@ -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>
2 changes: 1 addition & 1 deletion Authors
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion nova/db/sqlalchemy/api.py
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions nova/tests/test_db_api.py
Expand Up @@ -151,6 +151,8 @@ def test_network_delete_safe(self):
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'])
Expand Down

0 comments on commit c1e54e1

Please sign in to comment.