* allow json in env variables
This commit is contained in:
committed by
Alexander Malysh
parent
b30c1523e3
commit
c3032feaf7
@@ -1,3 +1,4 @@
|
|||||||
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
from typing import Any
|
from typing import Any
|
||||||
@@ -20,6 +21,11 @@ def _get_var_typed(val):
|
|||||||
return True
|
return True
|
||||||
elif val.lower() in ("f", "false"):
|
elif val.lower() in ("f", "false"):
|
||||||
return False
|
return False
|
||||||
|
# try to convert from json
|
||||||
|
try:
|
||||||
|
return json.loads(val)
|
||||||
|
except json.decoder.JSONDecodeError:
|
||||||
|
pass
|
||||||
# keep as string
|
# keep as string
|
||||||
return val
|
return val
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user