summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorSoren Hansen <soren@linux2go.dk>2011-01-19 22:38:57 +0000
committerTarmac <>2011-01-19 22:38:57 +0000
commit6e803acaf421e5bd8a8a2f9221a617939d582e31 (patch)
tree274716f2821b40c4d36dd0396d7e8bd30cb36d4d /nova
parentff9ec3576c4efb24baa657405591ead991ea1287 (diff)
parent8d828520602dd3fc66fa0ea22af797c1d99d3f1a (diff)
Eagerly load fixed_ip.network in instance_get_by_id.
Diffstat (limited to 'nova')
-rw-r--r--nova/db/sqlalchemy/api.py3
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).\