summaryrefslogtreecommitdiffstats
path: root/nova/db
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2010-12-22 22:04:30 +0000
committerTarmac <>2010-12-22 22:04:30 +0000
commit5f3f5acbddd66dfb3e8203724ed0ff9d0be3d5ae (patch)
treeebe0a7e1bc18fed15aa0eef26a16746f274ca1be /nova/db
parenteb64fe72160ca7c68809eaf0af91768f4eb5d8e8 (diff)
parent0704c0c4073f6c03959c113f90c51dfe4d72fd76 (diff)
Moves the ip allocation requests to the from the api host into calls to the network host made from the compute host.
Diffstat (limited to 'nova/db')
-rw-r--r--nova/db/sqlalchemy/api.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py
index 5ba458241..52d0c389d 100644
--- a/nova/db/sqlalchemy/api.py
+++ b/nova/db/sqlalchemy/api.py
@@ -463,6 +463,7 @@ def floating_ip_get_by_address(context, address, session=None):
session = get_session()
result = session.query(models.FloatingIp).\
+ options(joinedload_all('fixed_ip.network')).\
filter_by(address=address).\
filter_by(deleted=can_read_deleted(context)).\
first()
@@ -659,13 +660,17 @@ def instance_get(context, instance_id, session=None):
if is_admin_context(context):
result = session.query(models.Instance).\
+ options(joinedload_all('fixed_ip.floating_ips')).\
options(joinedload('security_groups')).\
+ options(joinedload('volumes')).\
filter_by(id=instance_id).\
filter_by(deleted=can_read_deleted(context)).\
first()
elif is_user_context(context):
result = session.query(models.Instance).\
+ options(joinedload_all('fixed_ip.floating_ips')).\
options(joinedload('security_groups')).\
+ options(joinedload('volumes')).\
filter_by(project_id=context.project_id).\
filter_by(id=instance_id).\
filter_by(deleted=False).\