mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-29 10:10:19 +00:00
matrixsynapse: Use yaml.safe_load
yaml.load() now requires a Loader= argument. yaml.safe_load() passes SafeLoader to yaml.load(). Fixes: #2315. Tests: - Matrix functional tests passed in testing container. - Matrix functional tests passed in stable container. Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
b49afbc4ff
commit
982fec5a60
@ -49,7 +49,7 @@ def post_install():
|
|||||||
|
|
||||||
# start with listener config from original homeserver.yaml
|
# start with listener config from original homeserver.yaml
|
||||||
with open(ORIG_CONF_PATH, encoding='utf-8') as orig_conf_file:
|
with open(ORIG_CONF_PATH, encoding='utf-8') as orig_conf_file:
|
||||||
orig_config = yaml.load(orig_conf_file)
|
orig_config = yaml.safe_load(orig_conf_file)
|
||||||
|
|
||||||
listeners = orig_config['listeners']
|
listeners = orig_config['listeners']
|
||||||
for listener in listeners:
|
for listener in listeners:
|
||||||
@ -77,11 +77,11 @@ def public_registration(command: str) -> Optional[bool]:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
with open(REGISTRATION_CONF_PATH, encoding='utf-8') as reg_conf_file:
|
with open(REGISTRATION_CONF_PATH, encoding='utf-8') as reg_conf_file:
|
||||||
config = yaml.load(reg_conf_file)
|
config = yaml.safe_load(reg_conf_file)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
# Check if its set in original conffile.
|
# Check if its set in original conffile.
|
||||||
with open(ORIG_CONF_PATH, encoding='utf-8') as orig_conf_file:
|
with open(ORIG_CONF_PATH, encoding='utf-8') as orig_conf_file:
|
||||||
orig_config = yaml.load(orig_conf_file)
|
orig_config = yaml.safe_load(orig_conf_file)
|
||||||
config = {
|
config = {
|
||||||
'enable_registration':
|
'enable_registration':
|
||||||
orig_config.get('enable_registration', False)
|
orig_config.get('enable_registration', False)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user