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

added startup logging messages

parent 25c6fef0
Branches
Tags
No related merge requests found
...@@ -38,6 +38,9 @@ def create_app(): ...@@ -38,6 +38,9 @@ def create_app():
if "SETTINGS_FILENAME" not in os.environ: if "SETTINGS_FILENAME" not in os.environ:
assert False, \ assert False, \
"environment variable SETTINGS_FILENAME' must be defined" "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") app.config.from_envvar("SETTINGS_FILENAME")
assert "INVENTORY_PROVIDER_CONFIG_FILENAME" in app.config, ( assert "INVENTORY_PROVIDER_CONFIG_FILENAME" in app.config, (
...@@ -51,8 +54,10 @@ def create_app(): ...@@ -51,8 +54,10 @@ def create_app():
from inventory_provider import config from inventory_provider import config
with open(app.config["INVENTORY_PROVIDER_CONFIG_FILENAME"]) as f: with open(app.config["INVENTORY_PROVIDER_CONFIG_FILENAME"]) as f:
# test the config file can be loaded # 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) app.config["INVENTORY_PROVIDER_CONFIG"] = config.load(f)
logging.debug(app.config) logging.info('Inventory Provider Flask app initialized')
return app return app
...@@ -67,6 +67,9 @@ class InventoryTask(Task): ...@@ -67,6 +67,9 @@ class InventoryTask(Task):
class WorkerArgs(bootsteps.Step): class WorkerArgs(bootsteps.Step):
def __init__(self, worker, config_filename, **options): def __init__(self, worker, config_filename, **options):
with open(config_filename) as f: 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) InventoryTask.config = config.load(f)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment