Modify the message of LOG

"host_state" is a object, we may not get the host name
in the log message, as the following:
<zun.scheduler.host_state.HostState object at 0x7f391c362590>
has not been heard from in a while

Change-Id: Ifb6a4c909923f03ac4079aeb16bf1d64100f597f
This commit is contained in:
weikeyou 2018-04-09 16:36:04 +08:00
parent b5cf60a4f0
commit 98c1d4a388

View File

@ -36,12 +36,12 @@ class ComputeFilter(filters.BaseHostFilter):
service = host_state.service
if service.disabled:
LOG.debug('%(host_state)s is disabled, reason: %(reason)s',
{'host_state': host_state,
{'host_state': host_state.hostname,
'reason': service.disabled_reason or 'Unknow'})
return False
else:
if not self.servicegroup_api.service_is_up(service):
LOG.warning('%(host_state)s has not been heard from in '
'a while', {'host_state': host_state})
'a while', {'host_state': host_state.hostname})
return False
return True