diff options
| author | Soren Hansen <soren@linux2go.dk> | 2011-01-19 17:03:09 +0100 |
|---|---|---|
| committer | Soren Hansen <soren@linux2go.dk> | 2011-01-19 17:03:09 +0100 |
| commit | 8d828520602dd3fc66fa0ea22af797c1d99d3f1a (patch) | |
| tree | 7f745b75bf9f4769b6869f884984a41abe7743d7 /nova/db | |
| parent | 7d7fbf5dfd8a8e10f584df5d27d3479c4b2b4d3a (diff) | |
| download | nova-8d828520602dd3fc66fa0ea22af797c1d99d3f1a.tar.gz nova-8d828520602dd3fc66fa0ea22af797c1d99d3f1a.tar.xz nova-8d828520602dd3fc66fa0ea22af797c1d99d3f1a.zip | |
Eagerly load instance's fixed_ip.network attribute.
Diffstat (limited to 'nova/db')
| -rw-r--r-- | nova/db/sqlalchemy/api.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index b63b84bed..7b965f672 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -777,7 +777,7 @@ def instance_get_by_id(context, instance_id): result = session.query(models.Instance).\ options(joinedload_all('fixed_ip.floating_ips')).\ options(joinedload('security_groups')).\ - options(joinedload_all('fixed_ip.floating_ips')).\ + options(joinedload_all('fixed_ip.network')).\ filter_by(id=instance_id).\ filter_by(deleted=can_read_deleted(context)).\ first() @@ -785,6 +785,7 @@ def instance_get_by_id(context, instance_id): result = session.query(models.Instance).\ options(joinedload('security_groups')).\ options(joinedload_all('fixed_ip.floating_ips')).\ + options(joinedload_all('fixed_ip.network')).\ filter_by(project_id=context.project_id).\ filter_by(id=instance_id).\ filter_by(deleted=False).\ |
