mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #27305 from cachedout/issue_27103
Re-init logging system on Windows when using multiprocessing
This commit is contained in:
commit
6f3da863fc
1 changed files with 7 additions and 0 deletions
|
@ -979,6 +979,13 @@ class Minion(MinionBase):
|
|||
'''
|
||||
# this seems awkward at first, but it's a workaround for Windows
|
||||
# multiprocessing communication.
|
||||
if sys.platform.startswith('win') and \
|
||||
opts['multiprocessing'] and \
|
||||
not salt.log.is_logging_configured():
|
||||
# We have to re-init the logging system for Windows
|
||||
salt.log.setup_console_logger(log_level=opts.get('log_level', 'info'))
|
||||
if opts.get('log_file'):
|
||||
salt.log.setup_logfile_logger(opts['log_file'], opts.get('log_level_logfile', 'info'))
|
||||
if not minion_instance:
|
||||
minion_instance = cls(opts)
|
||||
if not hasattr(minion_instance, 'functions'):
|
||||
|
|
Loading…
Add table
Reference in a new issue