diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-05-16 20:21:40 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-05-16 20:21:40 +0000 |
| commit | eb96b41a022fb2786a6bb7a4950b2826a2de46c6 (patch) | |
| tree | e24a2c286099c9df979e1901acc7a74a38bd38eb | |
| parent | 93cb89ebef52290463f1cb2681e14b9cb3559c8f (diff) | |
| parent | f50a5ec1fc53d77d7a4f33392ec6adc4637a53b5 (diff) | |
| download | nova-eb96b41a022fb2786a6bb7a4950b2826a2de46c6.tar.gz nova-eb96b41a022fb2786a6bb7a4950b2826a2de46c6.tar.xz nova-eb96b41a022fb2786a6bb7a4950b2826a2de46c6.zip | |
Merge "Add __repr__ to least_cost scheduler."
| -rw-r--r-- | nova/scheduler/least_cost.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nova/scheduler/least_cost.py b/nova/scheduler/least_cost.py index f10e2c4b4..45b76bb47 100644 --- a/nova/scheduler/least_cost.py +++ b/nova/scheduler/least_cost.py @@ -67,6 +67,11 @@ class WeightedHost(object): x['host'] = self.host_state.host return x + def __repr__(self): + if self.host_state: + return "WeightedHost host: %s" % self.host_state.host + return "WeightedHost with no host_state" + def noop_cost_fn(host_state, weighing_properties): """Return a pre-weight cost of 1 for each host""" |
