svn-support: Use shlex to split the reload command for subprocess usage.

This commit is contained in:
Martin Bornhold 2016-10-14 15:41:22 +02:00
parent 2a2581e7b3
commit b81e0eb4d5

View file

@ -20,6 +20,7 @@
import logging
import os
import shlex
# Do not use `from rhodecode import events` here, it will be overridden by the
# events module in this package due to pythons import mechanism.
@ -46,11 +47,11 @@ def includeme(config):
# Prepare reload command to pass it to the subprocess module and add a
# subscriber to execute it on configuration changes.
cmd = settings[config_keys.reload_command]
cmd = cmd.split(' ') if cmd else cmd
config.add_subscriber(
AsyncSubprocessSubscriber(cmd=cmd, timeout=5),
ModDavSvnConfigChange)
reload_cmd = shlex.split(settings[config_keys.reload_command])
reload_timeout = settings[config_keys.reload_timeout] or None
config_change_subscriber = AsyncSubprocessSubscriber(
cmd=reload_cmd, timeout=reload_timeout)
config.add_subscriber(config_change_subscriber, ModDavSvnConfigChange)
def _sanitize_settings_and_apply_defaults(settings):