mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge pull request #30726 from sjmh/fix/log4mongo
Fix improper use of yield in generator
This commit is contained in:
commit
ce3be26e8f
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user