Merge lp:~cbehrens/nova/lp824967 into lp:~hudson-openstack/nova/trunk

Proposed by Chris Behrens
Status: Merged
Approved by: Brian Lamar
Approved revision: 1418
Merged at revision: 1418
Proposed branch: lp:~cbehrens/nova/lp824967
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 23 lines (+5/-1)
1 file modified
nova/db/sqlalchemy/api.py (+5/-1)
To merge this branch: bzr merge lp:~cbehrens/nova/lp824967
Reviewer Review Type Date Requested Status
Brian Lamar (community) Approve
Josh Kearney (community) Approve
Review via email: mp+71302@code.launchpad.net

Description of the change

API needs virtual_interfaces.instance joined when pulling instances from the DB. Updated instance_get_all() to match instance_get_all_by_filters() even though the former is only used by nova-manage now. (The latter is used by the API).

To post a comment you must log in.
Revision history for this message
Josh Kearney (jk0) wrote :

LGTM

review: Approve
Revision history for this message
Brian Lamar (blamar) wrote :

This DB API is getting to be a pain...but this fix works for me and I know no other way! Good stuff.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/db/sqlalchemy/api.py'
2--- nova/db/sqlalchemy/api.py 2011-08-09 23:34:51 +0000
3+++ nova/db/sqlalchemy/api.py 2011-08-12 05:08:23 +0000
4@@ -1139,7 +1139,10 @@
5 session = get_session()
6 return session.query(models.Instance).\
7 options(joinedload_all('fixed_ips.floating_ips')).\
8- options(joinedload('virtual_interfaces')).\
9+ options(joinedload_all('virtual_interfaces.network')).\
10+ options(joinedload_all(
11+ 'virtual_interfaces.fixed_ips.floating_ips')).\
12+ options(joinedload('virtual_interfaces.instance')).\
13 options(joinedload('security_groups')).\
14 options(joinedload_all('fixed_ips.network')).\
15 options(joinedload('metadata')).\
16@@ -1202,6 +1205,7 @@
17 options(joinedload_all('virtual_interfaces.network')).\
18 options(joinedload_all(
19 'virtual_interfaces.fixed_ips.floating_ips')).\
20+ options(joinedload('virtual_interfaces.instance')).\
21 options(joinedload('security_groups')).\
22 options(joinedload_all('fixed_ips.network')).\
23 options(joinedload('metadata')).\