Merge pull request #30726 from sjmh/fix/log4mongo

Fix improper use of yield in generator
This commit is contained in:
Mike Place 2016-02-01 11:13:24 -07:00
commit ce3be26e8f

View File

@ -69,9 +69,7 @@ class FormatterWithHost(logging.Formatter, NewStyleClassMixIn):
def setup_handlers(): def setup_handlers():
handler_id = 'log4mongo_handler' handler_id = 'log4mongo_handler'
if handler_id not in __opts__: if handler_id in __opts__:
yield False
config_fields = { config_fields = {
'host': 'host', 'host': 'host',
'port': 'port', 'port': 'port',
@ -97,5 +95,6 @@ def setup_handlers():
formatter=FormatterWithHost(), formatter=FormatterWithHost(),
**config_opts **config_opts
) )
yield handler yield handler
else:
yield False