Merge "Improve "service is down or disabled" warning message"

This commit is contained in:
Jenkins 2013-05-27 02:24:18 +00:00 committed by Gerrit Code Review
commit 05ce36aa24
2 changed files with 6 additions and 4 deletions

View File

@ -262,10 +262,11 @@ class HostManager(object):
topic = FLAGS.volume_topic
volume_services = db.service_get_all_by_topic(context, topic)
for service in volume_services:
if not utils.service_is_up(service) or service['disabled']:
LOG.warn(_("service is down or disabled."))
continue
host = service['host']
if not utils.service_is_up(service) or service['disabled']:
LOG.warn(_("volume service is down or disabled. "
"(host: %s)") % host)
continue
capabilities = self.service_states.get(host, None)
host_state = self.host_state_map.get(host)
if host_state:

View File

@ -145,7 +145,8 @@ class HostManagerTestCase(test.TestCase):
ret_services = fakes.VOLUME_SERVICES
db.service_get_all_by_topic(context, topic).AndReturn(ret_services)
# Disabled service
host_manager.LOG.warn("service is down or disabled.")
host_manager.LOG.warn("volume service is down or disabled. "
"(host: host5)")
self.mox.ReplayAll()
self.host_manager.get_all_host_states(context)