Don't mask out HostState details in WeighedHost

WeighedHost's __repr__ was poking under the HostState hood to use
.host in its own __repr__ but this hides some important details.
Specifically it hides the hypervisor_hostname, which is important for
Ironic as one 'node' can have thousands of hostnames. The other
details such as available RAM and so on are also useful for ops trying
to debug scheduling issues, so rather than add hypervisor_hostname, I
am just delegating to the underlying __repr__.

Change-Id: I79e55c32b3d0768430132275ebe050f38c63bc87
This commit is contained in:
Robert Collins 2014-07-14 15:38:01 +12:00
parent 101d16237c
commit 97b667d651
1 changed files with 2 additions and 2 deletions

View File

@ -31,8 +31,8 @@ class WeighedHost(weights.WeighedObject):
return x
def __repr__(self):
return "WeighedHost [host: %s, weight: %s]" % (
self.obj.host, self.weight)
return "WeighedHost [host: %r, weight: %s]" % (
self.obj, self.weight)
class BaseHostWeigher(weights.BaseWeigher):