From d99594a33686ccb31f668e09c0750319d8bce83a Mon Sep 17 00:00:00 2001 From: Wen Zhi Yu Date: Wed, 2 Mar 2016 16:21:10 +0800 Subject: [PATCH] Fix missing of unit in HostState.__repr__() Unit of RAM and Disk size is missing in HostState.__repr__(), see[1] [1]https://github.com/openstack/nova/blob/13.0.0.0b2/nova/scheduler/host_manager.py#L311 Change-Id: Ibb9a06a0eaa112c3a575080b0775cc2fd97d53cc --- nova/scheduler/host_manager.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/nova/scheduler/host_manager.py b/nova/scheduler/host_manager.py index d5f476c9e139..d8a09d1f4db9 100644 --- a/nova/scheduler/host_manager.py +++ b/nova/scheduler/host_manager.py @@ -310,9 +310,13 @@ class HostState(object): self.num_io_ops += 1 def __repr__(self): - return ("(%s, %s) ram:%s disk:%s io_ops:%s instances:%s" % - (self.host, self.nodename, self.free_ram_mb, self.free_disk_mb, - self.num_io_ops, self.num_instances)) + return ("(%(host)s, %(node)s) ram: %(free_ram)sMB " + "disk: %(free_disk)sMB io_ops: %(num_io_ops)s " + "instances: %(num_instances)s" % + {'host': self.host, 'node': self.nodename, + 'free_ram': self.free_ram_mb, 'free_disk': self.free_disk_mb, + 'num_io_ops': self.num_io_ops, + 'num_instances': self.num_instances}) class HostManager(object):