Merge "api: remove v1 handling"

This commit is contained in:
Jenkins 2015-07-09 15:06:38 +00:00 committed by Gerrit Code Review
commit 28f47df9e5
2 changed files with 6 additions and 19 deletions

View File

@ -91,23 +91,6 @@ def setup_app(pecan_config=None):
return app
class VersionSelectorApplication(object):
def __init__(self):
pc = get_pecan_config()
def not_found(environ, start_response):
start_response('404 Not Found', [])
return []
self.v1 = not_found
self.v2 = setup_app(pecan_config=pc)
def __call__(self, environ, start_response):
if environ['PATH_INFO'].startswith('/v1/'):
return self.v1(environ, start_response)
return self.v2(environ, start_response)
def load_app():
# Build the WSGI app
cfg_file = None
@ -145,5 +128,9 @@ def build_server():
app, processes=workers)
def _app():
return setup_app(get_pecan_config())
def app_factory(global_config, **local_conf):
return VersionSelectorApplication()
return _app()

View File

@ -33,5 +33,5 @@ def load_tests(loader, tests, pattern):
"""Provide a TestSuite to the discovery process."""
test_dir = os.path.join(os.path.dirname(__file__), TESTS_DIR)
return driver.build_tests(test_dir, loader, host=None,
intercept=app.VersionSelectorApplication,
intercept=app._app,
fixture_module=fixture_module)