From 70270b09bea4b112c9bc54605460d0a211ebde55 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 9 Feb 2015 17:28:11 -0500 Subject: [PATCH] Further merge fixes --- app.py | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/app.py b/app.py index d2ca7f7bd..f4d900b15 100644 --- a/app.py +++ b/app.py @@ -33,47 +33,19 @@ from util.config.provider import FileConfigProvider, TestConfigProvider from util.config.configutil import generate_secret_key from util.config.superusermanager import SuperUserManager -# pylint: disable=invalid-name,too-many-public-methods,too-few-public-methods,too-many-ancestors -class Config(BaseConfig): - """ Flask config enhanced with a `from_yamlfile` method """ - - def from_yamlfile(self, config_file): - with open(config_file) as f: - c = yaml.load(f) - if not c: - logger.debug('Empty YAML config file') - return - - if isinstance(c, str): - raise Exception('Invalid YAML config file: ' + str(c)) - - for key in c.iterkeys(): - if key.isupper(): - self[key] = c[key] - -class Flask(BaseFlask): - """ Extends the Flask class to implement our custom Config class. """ - - def make_config(self, instance_relative=False): - root_path = self.instance_path if instance_relative else self.root_path - return Config(root_path, self.default_config) - - OVERRIDE_CONFIG_DIRECTORY = 'conf/stack/' OVERRIDE_CONFIG_YAML_FILENAME = 'conf/stack/config.yaml' OVERRIDE_CONFIG_PY_FILENAME = 'conf/stack/config.py' OVERRIDE_CONFIG_KEY = 'QUAY_OVERRIDE_CONFIG' LICENSE_FILENAME = 'conf/stack/license.enc' ->>>>>>> master +CONFIG_PROVIDER = FileConfigProvider(OVERRIDE_CONFIG_DIRECTORY, 'config.yaml', 'config.py') app = Flask(__name__) logger = logging.getLogger(__name__) profile = logging.getLogger('profile') -CONFIG_PROVIDER = FileConfigProvider('conf/stack/', 'config.yaml', 'config.py') - # Instantiate the default configuration (for test or for normal operation). if 'TEST' in os.environ: CONFIG_PROVIDER = TestConfigProvider()