summaryrefslogtreecommitdiffstats
path: root/nova/db
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2011-10-27 17:55:27 +0000
committerGerrit Code Review <review@openstack.org>2011-10-27 17:55:27 +0000
commit16bacc3252b9a792159b247dcf9d2f3ebb6842ac (patch)
tree9cd8f3c556fbdd2a300baec64ff91547d50b454e /nova/db
parent3f319ebe4a47843c83de2403e8fcbef3d499b657 (diff)
parent61e5b8e7da3b36db9a09f80d62ebf2e276bbe88b (diff)
Merge "Revert how APIs get IP address info for instances"
Diffstat (limited to 'nova/db')
-rw-r--r--nova/db/sqlalchemy/api.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py
index f6a147e89..983c48145 100644
--- a/nova/db/sqlalchemy/api.py
+++ b/nova/db/sqlalchemy/api.py
@@ -1217,12 +1217,13 @@ def _build_instance_get(context, session=None):
session = get_session()
partial = session.query(models.Instance).\
- options(joinedload_all('fixed_ips.floating_ips')).\
- options(joinedload_all('fixed_ips.network')).\
- options(joinedload_all('security_groups.rules')).\
- options(joinedload('volumes')).\
- options(joinedload('metadata')).\
- options(joinedload('instance_type'))
+ options(joinedload_all('fixed_ips.floating_ips')).\
+ options(joinedload_all('fixed_ips.network')).\
+ options(joinedload_all('fixed_ips.virtual_interface')).\
+ options(joinedload_all('security_groups.rules')).\
+ options(joinedload('volumes')).\
+ options(joinedload('metadata')).\
+ options(joinedload('instance_type'))
if is_admin_context(context):
partial = partial.filter_by(deleted=can_read_deleted(context))
@@ -1287,10 +1288,13 @@ def instance_get_all_by_filters(context, filters):
session = get_session()
query_prefix = session.query(models.Instance).\
- options(joinedload('security_groups')).\
- options(joinedload('metadata')).\
- options(joinedload('instance_type')).\
- order_by(desc(models.Instance.created_at))
+ options(joinedload_all('fixed_ips.floating_ips')).\
+ options(joinedload_all('fixed_ips.network')).\
+ options(joinedload_all('fixed_ips.virtual_interface')).\
+ options(joinedload('security_groups')).\
+ options(joinedload('metadata')).\
+ options(joinedload('instance_type')).\
+ order_by(desc(models.Instance.created_at))
# Make a copy of the filters dictionary to use going forward, as we'll
# be modifying it and we shouldn't affect the caller's use of it.