diff options
| author | Chris Behrens <cbehrens@codestud.com> | 2012-02-08 23:53:20 +0000 |
|---|---|---|
| committer | Rick Harris <rconradharris@gmail.com> | 2012-05-16 12:10:47 -0500 |
| commit | f50a5ec1fc53d77d7a4f33392ec6adc4637a53b5 (patch) | |
| tree | 9835680030bd8eccff0d91a9307bae302ef497bf /nova | |
| parent | e4d8b4824d0a1492271e262d46b1f8f464128fb8 (diff) | |
Add __repr__ to least_cost scheduler.
Change-Id: I883dd5a734ef71cef915abf95a7125926e07f3d0
Diffstat (limited to 'nova')
| -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""" |
