From 431ba6b4ef79dec0fdd7e059546e8f474d307f2d Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 19 Nov 2021 23:52:10 +0100 Subject: [PATCH] lib: add cli option for lib.config Signed-off-by: Jens Langhammer --- authentik/lib/config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/authentik/lib/config.py b/authentik/lib/config.py index 51d16902d..c54345987 100644 --- a/authentik/lib/config.py +++ b/authentik/lib/config.py @@ -5,6 +5,7 @@ from contextlib import contextmanager from glob import glob from json import dumps, loads from json.decoder import JSONDecodeError +from sys import argv, stderr from time import time from typing import Any from urllib.parse import urlparse @@ -60,7 +61,7 @@ class ConfigLoader: "timestamp": time(), } output.update(kwargs) - print(dumps(output)) + print(dumps(output), file=stderr) def update(self, root: dict[str, Any], updatee: dict[str, Any]) -> dict[str, Any]: """Recursively update dictionary""" @@ -180,3 +181,6 @@ class ConfigLoader: CONFIG = ConfigLoader() + +if __name__ == "__main__": + print(CONFIG.y(argv[1]))