Merge lp:~jk0/nova/lp718847 into lp:~hudson-openstack/nova/trunk

Proposed by Josh Kearney
Status: Merged
Approved by: Josh Kearney
Approved revision: 928
Merged at revision: 928
Proposed branch: lp:~jk0/nova/lp718847
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 60 lines (+15/-6)
3 files modified
nova/scheduler/chance.py (+2/-2)
nova/scheduler/simple.py (+9/-3)
nova/scheduler/zone.py (+4/-1)
To merge this branch: bzr merge lp:~jk0/nova/lp718847
Reviewer Review Type Date Requested Status
Sandy Walsh (community) Approve
Vish Ishaya (community) Approve
Review via email: mp+55818@code.launchpad.net

Description of the change

Friendlier error message if there are no compute nodes are available.

To post a comment you must log in.
Revision history for this message
Vish Ishaya (vishvananda) wrote :

cool, that looks much better. LGTM

review: Approve
Revision history for this message
Sandy Walsh (sandy-walsh) wrote :

yup

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/scheduler/chance.py'
2--- nova/scheduler/chance.py 2011-03-31 18:08:49 +0000
3+++ nova/scheduler/chance.py 2011-03-31 19:38:34 +0000
4@@ -35,6 +35,6 @@
5 hosts = self.hosts_up(context, topic)
6 if not hosts:
7 raise driver.NoValidHost(_("Scheduler was unable to locate a host"
8- " for this request. Is the compute node"
9- " running?"))
10+ " for this request. Is the appropriate"
11+ " service running?"))
12 return hosts[int(random.random() * len(hosts))]
13
14=== modified file 'nova/scheduler/simple.py'
15--- nova/scheduler/simple.py 2011-01-27 22:14:10 +0000
16+++ nova/scheduler/simple.py 2011-03-31 19:38:34 +0000
17@@ -72,7 +72,9 @@
18 {'host': service['host'],
19 'scheduled_at': now})
20 return service['host']
21- raise driver.NoValidHost(_("No hosts found"))
22+ raise driver.NoValidHost(_("Scheduler was unable to locate a host"
23+ " for this request. Is the appropriate"
24+ " service running?"))
25
26 def schedule_create_volume(self, context, volume_id, *_args, **_kwargs):
27 """Picks a host that is up and has the fewest volumes."""
28@@ -107,7 +109,9 @@
29 {'host': service['host'],
30 'scheduled_at': now})
31 return service['host']
32- raise driver.NoValidHost(_("No hosts found"))
33+ raise driver.NoValidHost(_("Scheduler was unable to locate a host"
34+ " for this request. Is the appropriate"
35+ " service running?"))
36
37 def schedule_set_network_host(self, context, *_args, **_kwargs):
38 """Picks a host that is up and has the fewest networks."""
39@@ -119,4 +123,6 @@
40 raise driver.NoValidHost(_("All hosts have too many networks"))
41 if self.service_is_up(service):
42 return service['host']
43- raise driver.NoValidHost(_("No hosts found"))
44+ raise driver.NoValidHost(_("Scheduler was unable to locate a host"
45+ " for this request. Is the appropriate"
46+ " service running?"))
47
48=== modified file 'nova/scheduler/zone.py'
49--- nova/scheduler/zone.py 2011-01-11 22:27:36 +0000
50+++ nova/scheduler/zone.py 2011-03-31 19:38:34 +0000
51@@ -52,5 +52,8 @@
52 zone = _kwargs.get('availability_zone')
53 hosts = self.hosts_up_with_zone(context, topic, zone)
54 if not hosts:
55- raise driver.NoValidHost(_("No hosts found"))
56+ raise driver.NoValidHost(_("Scheduler was unable to locate a host"
57+ " for this request. Is the appropriate"
58+ " service running?"))
59+
60 return hosts[int(random.random() * len(hosts))]