pep8 fixes

This commit is contained in:
Naveed Massjouni 2011-06-01 10:17:00 -04:00
parent 46ddecc177
commit 9fc8e71f1b
2 changed files with 5 additions and 4 deletions

View File

@ -272,7 +272,7 @@ class PublishErrorsHandler(logging.Handler):
def emit(self, record):
nova.notifier.api.notify('nova.error.publisher', 'error_notification',
nova.notifier.api.ERROR, dict(error=record.msg))
def handle_exception(type, value, tb):
extra = {}

View File

@ -122,12 +122,13 @@ class NotifierTestCase(test.TestCase):
self.stubs.Set(nova.flags.FLAGS, 'publish_errors', True)
LOG = log.getLogger('nova')
LOG.setup_from_flags()
msgs = []
def mock_cast(context, topic, data):
msgs.append(data)
self.stubs.Set(nova.rpc, 'cast', mock_cast)
LOG.error('foo');
self.stubs.Set(nova.rpc, 'cast', mock_cast)
LOG.error('foo')
self.assertEqual(1, len(msgs))
msg = msgs[0]
self.assertEqual(msg['event_type'], 'error_notification')