From 92c344e338c630d0b0632c93f9eb5f70a9e059c0 Mon Sep 17 00:00:00 2001 From: Rok Garbas Date: Thu, 18 Aug 2016 13:13:15 +0200 Subject: [PATCH] relengapi_common: db common extension should be always applied as last cache extension should not be present as default --- .../relengapi_clobberer/__init__.py | 4 ++-- src/relengapi_common/relengapi_common/__init__.py | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/relengapi_clobberer/relengapi_clobberer/__init__.py b/src/relengapi_clobberer/relengapi_clobberer/__init__.py index acd6adbe..278cb7f2 100644 --- a/src/relengapi_clobberer/relengapi_clobberer/__init__.py +++ b/src/relengapi_clobberer/relengapi_clobberer/__init__.py @@ -6,7 +6,7 @@ from __future__ import absolute_import import os -from relengapi_common import db, create_app +from relengapi_common import db, cache, create_app DEBUG = bool(os.environ.get('DEBUG', __name__ == '__main__')) @@ -31,7 +31,7 @@ if not os.environ.get('APP_SETTINGS') and \ app = create_app( "relengapi_clobberer", - extensions=[db, init_app], + extensions=[cache, init_app, db], debug=DEBUG, debug_src=HERE, ) diff --git a/src/relengapi_common/relengapi_common/__init__.py b/src/relengapi_common/relengapi_common/__init__.py index 6ab3b481..060e7355 100644 --- a/src/relengapi_common/relengapi_common/__init__.py +++ b/src/relengapi_common/relengapi_common/__init__.py @@ -11,7 +11,7 @@ import sys from flask import Flask, send_from_directory -from relengapi_common import api, auth, log, cache, cors +import relengapi_common __APP = dict() @@ -45,9 +45,13 @@ def create_app(name, extensions=[], config=None, debug=False, debug_src=None, app.jinja_loader = jinja2.loaders.FileSystemLoader( os.path.join(os.path.dirname(__file__), 'templates')) - base_extensions = [log, auth, api, cache] + base_extensions = [ + relengapi_common.log, + relengapi_common.auth, + relengapi_common.api, + ] if app.debug is True: - base_extensions.append(cors) + base_extensions.append(relengapi_common.cors) for extension in base_extensions + extensions: