summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2011-12-23 14:07:32 +0000
committerGerrit Code Review <review@openstack.org>2011-12-23 14:07:32 +0000
commitf78d266598d6cfd7015b1ba9adffd909beb03b22 (patch)
tree06948b114e00d5fc842887b14820422535b2b9ff
parent7db38e4d40bf406f23e7ca2717824e230897cc41 (diff)
parent5cf93a39dc59f1040a5118bdc74a00cb3eb3163a (diff)
Merge "Fixes LP bug #907898."
-rw-r--r--nova/db/sqlalchemy/api.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py
index 2163ba8ca..c1e003b18 100644
--- a/nova/db/sqlalchemy/api.py
+++ b/nova/db/sqlalchemy/api.py
@@ -777,12 +777,12 @@ def fixed_ip_disassociate_all_by_timeout(context, host, time):
session = get_session()
# NOTE(vish): only update fixed ips that "belong" to this
# host; i.e. the network host or the instance
- # host matches. Inner queries necessary because
+ # host matches. Two queries necessary because
# join with update doesn't work.
host_filter = or_(and_(models.Instance.host == host,
models.Network.multi_host == True),
models.Network.host == host)
- subq = model_query(context, models.FixedIp.id, session=session,
+ fixed_ips = model_query(context, models.FixedIp.id, session=session,
read_deleted="yes").\
filter(models.FixedIp.updated_at < time).\
filter(models.FixedIp.instance_id != None).\
@@ -790,10 +790,10 @@ def fixed_ip_disassociate_all_by_timeout(context, host, time):
join(models.FixedIp.instance).\
join(models.FixedIp.network).\
filter(host_filter).\
- subquery()
+ all()
result = model_query(context, models.FixedIp, session=session,
read_deleted="yes").\
- filter(models.FixedIp.id.in_(subq)).\
+ filter(models.FixedIp.id.in_(fixed_ips)).\
update({'instance_id': None,
'leased': False,
'updated_at': utils.utcnow()},