lib: add support for file:// protocol in config file

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-05-04 22:53:59 +02:00
parent b1c9126832
commit ba57bf4fa2

View file

@ -86,6 +86,9 @@ class ConfigLoader:
url = urlparse(value)
if url.scheme == "env":
value = os.getenv(url.netloc, url.query)
if url.scheme == "file":
with open(url.netloc, 'r') as _file:
value = _file.read()
return value
def update_from_file(self, path: str):