From c2284fb97d5ce22c72777e48ea83c6a13425ad51 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 30 Jun 2015 16:51:36 +0200 Subject: [PATCH] api: remove v1 handling We never had a v2 version of the alarming API, so let's ignore that. Change-Id: Ibb2f7d40fc4fc24e849c365419c003f6ab999f17 --- aodh/api/app.py | 23 +++++------------------ aodh/tests/gabbi/test_gabbi.py | 2 +- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/aodh/api/app.py b/aodh/api/app.py index 7e45e7dd7..025bf2ae0 100644 --- a/aodh/api/app.py +++ b/aodh/api/app.py @@ -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() diff --git a/aodh/tests/gabbi/test_gabbi.py b/aodh/tests/gabbi/test_gabbi.py index 2bf1a59a8..004f79587 100644 --- a/aodh/tests/gabbi/test_gabbi.py +++ b/aodh/tests/gabbi/test_gabbi.py @@ -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)