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

added startup logging messages

parent 25c6fef0
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,9 @@ def create_app():
if "SETTINGS_FILENAME" not in os.environ:
assert False, \
"environment variable SETTINGS_FILENAME' must be defined"
logging.info("initializing Flask with config from: %r"
% app.config["SETTINGS_FILENAME"])
app.config.from_envvar("SETTINGS_FILENAME")
assert "INVENTORY_PROVIDER_CONFIG_FILENAME" in app.config, (
......@@ -51,8 +54,10 @@ def create_app():
from inventory_provider import config
with open(app.config["INVENTORY_PROVIDER_CONFIG_FILENAME"]) as f:
# test the config file can be loaded
logging.info("loading config from: %r"
% app.config["INVENTORY_PROVIDER_CONFIG_FILENAME"])
app.config["INVENTORY_PROVIDER_CONFIG"] = config.load(f)
logging.debug(app.config)
logging.info('Inventory Provider Flask app initialized')
return app
......@@ -67,6 +67,9 @@ class InventoryTask(Task):
class WorkerArgs(bootsteps.Step):
def __init__(self, worker, config_filename, **options):
with open(config_filename) as f:
task_logger = logging.getLogger(constants.TASK_LOGGER_NAME)
task_logger.info(
"Initializing worker with config from: %r % config_filename)"
InventoryTask.config = config.load(f)
......
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