Skip to content
Snippets Groups Projects
Commit a9719568 authored by Erik Reid's avatar Erik Reid
Browse files

read ENABLE_TEST_ROUTES flag from flask settings

was previously read from the environment
parent 79de1e6c
No related branches found
No related tags found
No related merge requests found
......@@ -39,11 +39,6 @@ def create_app():
from inventory_provider.routes import poller
app.register_blueprint(poller.routes, url_prefix='/poller')
if "ENABLE_TESTING_ROUTES" in os.environ:
from inventory_provider.routes import testing
app.register_blueprint(testing.routes, url_prefix='/testing')
logging.warning('DANGER!!! testing routes enabled')
logging.info("initializing Flask with config from: %r"
% os.environ["SETTINGS_FILENAME"])
app.config.from_envvar("SETTINGS_FILENAME")
......@@ -56,6 +51,11 @@ def create_app():
"config file '%s' not found" %
app.config["INVENTORY_PROVIDER_CONFIG_FILENAME"])
if app.config.get('ENABLE_TESTING_ROUTES', False):
from inventory_provider.routes import testing
app.register_blueprint(testing.routes, url_prefix='/testing')
logging.warning('DANGER!!! testing routes enabled')
from inventory_provider import config
with open(app.config["INVENTORY_PROVIDER_CONFIG_FILENAME"]) as f:
# test the config file can be loaded
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment