# HG changeset patch # User Martin Bornhold # Date 2016-10-04 09:24:56 # Node ID ebfb39d8442a00375c146a2b0b4f7e8efaf4b6b7 # Parent b3b912d40d379422c500832363862786980591d4 vcs: Raise exception if unknown protocol specified for vcs server protocol. diff --git a/rhodecode/lib/vcs/__init__.py b/rhodecode/lib/vcs/__init__.py --- a/rhodecode/lib/vcs/__init__.py +++ b/rhodecode/lib/vcs/__init__.py @@ -137,6 +137,8 @@ def connect_vcs(server_and_port, protoco connect_pyro4(server_and_port) elif protocol == 'http': connect_http(server_and_port) + else: + raise Exception('Invalid vcs server protocol "{}"'.format(protocol)) # TODO: johbo: This function should be moved into our test suite, there is @@ -150,6 +152,8 @@ def start_vcs_server(server_and_port, pr return _start_http_vcs_server(server_and_port, log_level) elif protocol == 'pyro4': return _start_pyro4_vcs_server(server_and_port, log_level) + else: + raise Exception('Invalid vcs server protocol "{}"'.format(protocol)) def _start_pyro4_vcs_server(server_and_port, log_level=None): @@ -216,6 +220,8 @@ def create_vcsserver_proxy(server_and_po return _create_vcsserver_proxy_pyro4(server_and_port) elif protocol == 'http': return _create_vcsserver_proxy_http(server_and_port) + else: + raise Exception('Invalid vcs server protocol "{}"'.format(protocol)) def _create_vcsserver_proxy_pyro4(server_and_port):