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
1=== modified file 'nova/api/ec2/cloud.py'
2--- nova/api/ec2/cloud.py 2011-01-10 14:49:34 +0000
3+++ nova/api/ec2/cloud.py 2011-01-10 16:06:51 +0000
4@@ -42,6 +42,7 @@
5
6
7 FLAGS = flags.FLAGS
8+flags.DECLARE('service_down_time', 'nova.scheduler.driver')
9
10 LOG = logging.getLogger("nova.api.cloud")
11
12@@ -198,7 +199,7 @@
13 'zoneState': 'available'}]}
14
15 services = db.service_get_all(context)
16- now = db.get_time()
17+ now = datetime.datetime.utcnow()
18 hosts = []
19 for host in [service['host'] for service in services]:
20 if not host in hosts:
21
22=== modified file 'nova/db/api.py'
23--- nova/db/api.py 2011-01-07 11:03:45 +0000
24+++ nova/db/api.py 2011-01-10 16:06:51 +0000
25@@ -81,6 +81,11 @@
26 return IMPL.service_get(context, service_id)
27
28
29+def service_get_all(context):
30+ """Get a list of all services on any machine on any topic of any type"""
31+ return IMPL.service_get_all(context)
32+
33+
34 def service_get_all_by_topic(context, topic):
35 """Get all compute services for a given topic."""
36 return IMPL.service_get_all_by_topic(context, topic)
37
38=== modified file 'nova/db/sqlalchemy/api.py'
39--- nova/db/sqlalchemy/api.py 2011-01-07 11:08:22 +0000
40+++ nova/db/sqlalchemy/api.py 2011-01-10 16:06:51 +0000
41@@ -135,6 +135,18 @@
42
43
44 @require_admin_context
45+def service_get_all(context, session=None):
46+ if not session:
47+ session = get_session()
48+
49+ result = session.query(models.Service).\
50+ filter_by(deleted=can_read_deleted(context)).\
51+ all()
52+
53+ return result
54+
55+
56+@require_admin_context
57 def service_get_all_by_topic(context, topic):
58 session = get_session()
59 return session.query(models.Service).\