Merge lp:~anso/nova/lp700974 into lp:~hudson-openstack/nova/trunk

Proposed by Todd Willey
Status: Merged
Approved by: Vish Ishaya
Approved revision: 536
Merged at revision: 538
Proposed branch: lp:~anso/nova/lp700974
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 59 lines (+19/-1)
3 files modified
nova/api/ec2/cloud.py (+2/-1)
nova/db/api.py (+5/-0)
nova/db/sqlalchemy/api.py (+12/-0)
To merge this branch: bzr merge lp:~anso/nova/lp700974
Reviewer Review Type Date Requested Status
Vish Ishaya (community) Approve
Devin Carlen (community) Approve
Review via email: mp+45706@code.launchpad.net

Description of the change

Bugfix.

To post a comment you must log in.
Revision history for this message
Devin Carlen (devcamcar) wrote :

lgtm

review: Approve
Revision history for this message
Vish Ishaya (vishvananda) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'nova/api/ec2/cloud.py'
--- nova/api/ec2/cloud.py 2011-01-10 14:49:34 +0000
+++ nova/api/ec2/cloud.py 2011-01-10 16:06:51 +0000
@@ -42,6 +42,7 @@
4242
4343
44FLAGS = flags.FLAGS44FLAGS = flags.FLAGS
45flags.DECLARE('service_down_time', 'nova.scheduler.driver')
4546
46LOG = logging.getLogger("nova.api.cloud")47LOG = logging.getLogger("nova.api.cloud")
4748
@@ -198,7 +199,7 @@
198 'zoneState': 'available'}]}199 'zoneState': 'available'}]}
199200
200 services = db.service_get_all(context)201 services = db.service_get_all(context)
201 now = db.get_time()202 now = datetime.datetime.utcnow()
202 hosts = []203 hosts = []
203 for host in [service['host'] for service in services]:204 for host in [service['host'] for service in services]:
204 if not host in hosts:205 if not host in hosts:
205206
=== modified file 'nova/db/api.py'
--- nova/db/api.py 2011-01-07 11:03:45 +0000
+++ nova/db/api.py 2011-01-10 16:06:51 +0000
@@ -81,6 +81,11 @@
81 return IMPL.service_get(context, service_id)81 return IMPL.service_get(context, service_id)
8282
8383
84def service_get_all(context):
85 """Get a list of all services on any machine on any topic of any type"""
86 return IMPL.service_get_all(context)
87
88
84def service_get_all_by_topic(context, topic):89def service_get_all_by_topic(context, topic):
85 """Get all compute services for a given topic."""90 """Get all compute services for a given topic."""
86 return IMPL.service_get_all_by_topic(context, topic)91 return IMPL.service_get_all_by_topic(context, topic)
8792
=== modified file 'nova/db/sqlalchemy/api.py'
--- nova/db/sqlalchemy/api.py 2011-01-07 11:08:22 +0000
+++ nova/db/sqlalchemy/api.py 2011-01-10 16:06:51 +0000
@@ -135,6 +135,18 @@
135135
136136
137@require_admin_context137@require_admin_context
138def service_get_all(context, session=None):
139 if not session:
140 session = get_session()
141
142 result = session.query(models.Service).\
143 filter_by(deleted=can_read_deleted(context)).\
144 all()
145
146 return result
147
148
149@require_admin_context
138def service_get_all_by_topic(context, topic):150def service_get_all_by_topic(context, topic):
139 session = get_session()151 session = get_session()
140 return session.query(models.Service).\152 return session.query(models.Service).\