Merge "fixed_ip_get_by_address read_deleted from context" into stable/essex

This commit is contained in:
Jenkins 2012-10-11 17:28:04 +00:00 committed by Gerrit Code Review
commit 17a6cd91ef
4 changed files with 5 additions and 2 deletions

View File

@ -80,3 +80,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>

View File

@ -101,7 +101,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>

View File

@ -1047,7 +1047,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:

View File

@ -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'])