From 98c1d4a388189dd901315e3b71c725a80f6f9f48 Mon Sep 17 00:00:00 2001 From: weikeyou Date: Mon, 9 Apr 2018 16:36:04 +0800 Subject: [PATCH] Modify the message of LOG "host_state" is a object, we may not get the host name in the log message, as the following: has not been heard from in a while Change-Id: Ifb6a4c909923f03ac4079aeb16bf1d64100f597f --- zun/scheduler/filters/compute_filter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zun/scheduler/filters/compute_filter.py b/zun/scheduler/filters/compute_filter.py index 1c25df3a1..89c621652 100644 --- a/zun/scheduler/filters/compute_filter.py +++ b/zun/scheduler/filters/compute_filter.py @@ -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