summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-09-04 08:18:02 +0000
committerGerrit Code Review <review@openstack.org>2014-09-04 08:18:02 +0000
commit7d9b8dcb1221ea9e3ea5988a1c0498fb90b84c98 (patch)
tree8cfd2cf4f23fb5d1faa83505da6636daa2f13c92
parent1f52b644140535a0079cd6ff2f5c4b736270f1bb (diff)
parent7ce8d7e53125c21e0fb834a8e04c953b17342e4c (diff)
downloadkeystone-2014.2.b3.tar.gz
Merge "Lower log level for notification registration"2014.2.b3
-rw-r--r--keystone/notifications.py7
-rw-r--r--keystone/tests/test_notifications.py10
2 files changed, 9 insertions, 8 deletions
diff --git a/keystone/notifications.py b/keystone/notifications.py
index 6a1ff4404..e3057b088 100644
--- a/keystone/notifications.py
+++ b/keystone/notifications.py
@@ -179,14 +179,13 @@ def register_event_callback(event, resource_type, callbacks):
_SUBSCRIBERS.setdefault(event, {}).setdefault(resource_type, set())
_SUBSCRIBERS[event][resource_type].add(callback)
- if LOG.logger.getEffectiveLevel() <= logging.INFO:
+ if LOG.logger.getEffectiveLevel() <= logging.DEBUG:
# Do this only if its going to appear in the logs.
- msg = _('Callback: `%(callback)s` subscribed to event '
- '`%(event)s`.')
+ msg = 'Callback: `%(callback)s` subscribed to event `%(event)s`.'
callback_info = _get_callback_info(callback)
callback_str = '.'.join(i for i in callback_info if i is not None)
event_str = '.'.join(['identity', resource_type, event])
- LOG.info(msg, {'callback': callback_str, 'event': event_str})
+ LOG.debug(msg, {'callback': callback_str, 'event': event_str})
def notify_event_callbacks(service, resource_type, operation, payload):
diff --git a/keystone/tests/test_notifications.py b/keystone/tests/test_notifications.py
index d51b181f0..f3381b61a 100644
--- a/keystone/tests/test_notifications.py
+++ b/keystone/tests/test_notifications.py
@@ -12,6 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
+import logging
import uuid
import mock
@@ -696,7 +697,7 @@ class TestCallbackRegistration(testtools.TestCase):
super(TestCallbackRegistration, self).setUp()
self.mock_log = mock.Mock()
# Force the callback logging to occur
- self.mock_log.logger.getEffectiveLevel.return_value = 1
+ self.mock_log.logger.getEffectiveLevel.return_value = logging.DEBUG
def verify_log_message(self, data):
"""Tests that use this are a little brittle because adding more
@@ -705,9 +706,10 @@ class TestCallbackRegistration(testtools.TestCase):
TODO(dstanek): remove the need for this in a future refactoring
"""
- self.assertEqual(len(data), self.mock_log.info.call_count)
- for i, data in enumerate(data):
- self.mock_log.info.assert_any_call(mock.ANY, data)
+ log_fn = self.mock_log.debug
+ self.assertEqual(len(data), log_fn.call_count)
+ for datum in data:
+ log_fn.assert_any_call(mock.ANY, datum)
def test_a_function_callback(self):
def callback(*args, **kwargs):