Merge lp:~jk0/nova/lp760342 into lp:~hudson-openstack/nova/trunk

Proposed by Josh Kearney
Status: Merged
Approved by: Josh Kearney
Approved revision: 1078
Merged at revision: 1081
Proposed branch: lp:~jk0/nova/lp760342
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 19 lines (+2/-0)
1 file modified
nova/db/sqlalchemy/api.py (+2/-0)
To merge this branch: bzr merge lp:~jk0/nova/lp760342
Reviewer Review Type Date Requested Status
Rick Harris (community) Approve
Ed Leafe (community) Approve
Review via email: mp+61181@code.launchpad.net

Description of the change

Added missing metadata join to instance_get calls.

To post a comment you must log in.
Revision history for this message
Ed Leafe (ed-leafe) wrote :

lgtm

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

Looks great, Josh.

Any chance we could write a test to cover this class of problems; for example, verifying that all instance relationships are accessible without triggering SA errors? (Perhaps with an eye to extending this to all models in the future...)

Revision history for this message
Josh Kearney (jk0) wrote :

> Any chance we could write a test to cover this class of problems; for example,
> verifying that all instance relationships are accessible without triggering SA
> errors? (Perhaps with an eye to extending this to all models in the future...)

Unfortunately I don't think I'll be able to for a couple reasons:

1) There's currently no DB testing suite (it's all faked), and I wouldn't have time to write that this week during the ending of our Sprint cycle.

2) I'm unable to reproduce this bug after spinning a clean build environment. My thoughts are that it was a one-off situation in our environment that triggered this exception.

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

lgtm

review: Approve
Revision history for this message
Josh Kearney (jk0) wrote :

I filed a bug (which should probably be a BP) for the lack of DB testing in Nova: https://bugs.launchpad.net/nova/+bug/784184

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-05-16 20:51:08 +0000
3+++ nova/db/sqlalchemy/api.py 2011-05-16 22:45:33 +0000
4@@ -873,6 +873,7 @@
5 options(joinedload_all('fixed_ip.floating_ips')).\
6 options(joinedload('security_groups')).\
7 options(joinedload_all('fixed_ip.network')).\
8+ options(joinedload('metadata')).\
9 options(joinedload('instance_type')).\
10 filter_by(deleted=can_read_deleted(context)).\
11 all()
12@@ -885,6 +886,7 @@
13 options(joinedload_all('fixed_ip.floating_ips')).\
14 options(joinedload('security_groups')).\
15 options(joinedload_all('fixed_ip.network')).\
16+ options(joinedload('metadata')).\
17 options(joinedload('instance_type')).\
18 filter_by(deleted=can_read_deleted(context)).\
19 filter_by(user_id=user_id).\