]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Improve "service is down or disabled" warning message
authorEric Harney <eharney@redhat.com>
Wed, 22 May 2013 14:14:38 +0000 (10:14 -0400)
committerEric Harney <eharney@redhat.com>
Fri, 24 May 2013 14:07:09 +0000 (10:07 -0400)
Include "volume" and host in this message to make it more useful.

Change-Id: I2cacc7373de3a1b51762df2844a46b393d96c6cc

cinder/scheduler/host_manager.py
cinder/tests/scheduler/test_host_manager.py

index 9dd2182f0946b965a54aa752f3684efce92c0a95..acc024f532b7a7af34fb695c900d85b3b79ca582 100644 (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:
+            host = service['host']
             if not utils.service_is_up(service) or service['disabled']:
-                LOG.warn(_("service is down or disabled."))
+                LOG.warn(_("volume service is down or disabled. "
+                           "(host: %s)") % host)
                 continue
-            host = service['host']
             capabilities = self.service_states.get(host, None)
             host_state = self.host_state_map.get(host)
             if host_state:
index 6196444dcb88aeee17e3e2cba2f093e1d9cb5a8e..2a3558fc9d0a6591c468aa981f595ce6f39482a0 100644 (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)