Merge pull request #37119 from jfindlay/log_proc_user

log.setup: only assign user if defined
This commit is contained in:
Mike Place 2016-10-21 14:14:55 +09:00 committed by GitHub
commit 169a82e62b
2 changed files with 7 additions and 2 deletions

View file

@ -930,8 +930,13 @@ def patch_python_logging_handlers():
def __process_multiprocessing_logging_queue(opts, queue):
import salt.utils
salt.utils.appendproctitle('MultiprocessingLoggingQueue')
# Assign UID/GID of user to proc if set
from salt.utils.verify import check_user
check_user(opts['user'])
user = opts.get('user')
if user:
check_user(user)
if salt.utils.is_windows():
# On Windows, creating a new process doesn't fork (copy the parent
# process image). Due to this, we need to setup extended logging

View file

@ -184,7 +184,7 @@ class TestDaemon(object):
'''
# Setup the multiprocessing logging queue listener
salt_log_setup.setup_multiprocessing_logging_listener(
self.parser.options
vars(self.parser.options)
)
# Set up PATH to mockbin