Merge "api: remove v1 handling"
This commit is contained in:
commit
28f47df9e5
@ -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()
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user