# HG changeset patch # User Martin Bornhold # Date 2016-10-14 13:41:22 # Node ID e68768e9e540330bd4f03b87dffba5f69ef3727d # Parent c9bcf1612846f1f5a07d1b76c486a393b38be096 svn-support: Use shlex to split the reload command for subprocess usage. diff --git a/rhodecode/svn_support/__init__.py b/rhodecode/svn_support/__init__.py --- a/rhodecode/svn_support/__init__.py +++ b/rhodecode/svn_support/__init__.py @@ -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):