Merge lp:~vishvananda/nova/lp716732 into lp:~hudson-openstack/nova/trunk

Proposed by Vish Ishaya
Status: Merged
Approved by: Soren Hansen
Approved revision: 665
Merged at revision: 665
Proposed branch: lp:~vishvananda/nova/lp716732
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 51 lines (+6/-0)
1 file modified
nova/db/sqlalchemy/api.py (+6/-0)
To merge this branch: bzr merge lp:~vishvananda/nova/lp716732
Reviewer Review Type Date Requested Status
Soren Hansen (community) Approve
Rick Harris (community) Approve
Jay Pipes (community) Approve
Review via email: mp+49453@code.launchpad.net

Description of the change

This fixes a lazy-load issue in describe-instances, which causes a crash. The solution is to specifically load the network table when retrieving an instance.

To post a comment you must log in.
Revision history for this message
Jay Pipes (jaypipes) wrote :

lgtm.

review: Approve
Revision history for this message
Rick Harris (rconradharris) wrote :

lgtm

review: Approve
Revision history for this message
Soren Hansen (soren) wrote :

lgtm

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-02-09 12:22:10 +0000
3+++ nova/db/sqlalchemy/api.py 2011-02-11 19:46:09 +0000
4@@ -719,6 +719,7 @@
5 return session.query(models.Instance).\
6 options(joinedload_all('fixed_ip.floating_ips')).\
7 options(joinedload('security_groups')).\
8+ options(joinedload_all('fixed_ip.network')).\
9 filter_by(deleted=can_read_deleted(context)).\
10 all()
11
12@@ -729,6 +730,7 @@
13 return session.query(models.Instance).\
14 options(joinedload_all('fixed_ip.floating_ips')).\
15 options(joinedload('security_groups')).\
16+ options(joinedload_all('fixed_ip.network')).\
17 filter_by(deleted=can_read_deleted(context)).\
18 filter_by(user_id=user_id).\
19 all()
20@@ -740,6 +742,7 @@
21 return session.query(models.Instance).\
22 options(joinedload_all('fixed_ip.floating_ips')).\
23 options(joinedload('security_groups')).\
24+ options(joinedload_all('fixed_ip.network')).\
25 filter_by(host=host).\
26 filter_by(deleted=can_read_deleted(context)).\
27 all()
28@@ -753,6 +756,7 @@
29 return session.query(models.Instance).\
30 options(joinedload_all('fixed_ip.floating_ips')).\
31 options(joinedload('security_groups')).\
32+ options(joinedload_all('fixed_ip.network')).\
33 filter_by(project_id=project_id).\
34 filter_by(deleted=can_read_deleted(context)).\
35 all()
36@@ -766,6 +770,7 @@
37 return session.query(models.Instance).\
38 options(joinedload_all('fixed_ip.floating_ips')).\
39 options(joinedload('security_groups')).\
40+ options(joinedload_all('fixed_ip.network')).\
41 filter_by(reservation_id=reservation_id).\
42 filter_by(deleted=can_read_deleted(context)).\
43 all()
44@@ -773,6 +778,7 @@
45 return session.query(models.Instance).\
46 options(joinedload_all('fixed_ip.floating_ips')).\
47 options(joinedload('security_groups')).\
48+ options(joinedload_all('fixed_ip.network')).\
49 filter_by(project_id=context.project_id).\
50 filter_by(reservation_id=reservation_id).\
51 filter_by(deleted=False).\