diff options
author | Jorik Schellekens <joriks@matrix.org> | 2019-08-28 10:08:51 +0100 |
---|---|---|
committer | Jorik Schellekens <joriks@matrix.org> | 2019-08-28 10:08:51 +0100 |
commit | 765d1f13d2b183dbd36c7d441741c0ab4719df14 (patch) | |
tree | 65c2ac3f8c0148413832d6162e4920abc7977f3a | |
parent | Docs (diff) | |
download | synapse-765d1f13d2b183dbd36c7d441741c0ab4719df14.tar.xz |
Explicitely read yaml for clarity.
-rw-r--r-- | synapse/config/__init__.py | 4 | ||||
-rwxr-xr-x | synctl | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/synapse/config/__init__.py b/synapse/config/__init__.py index 11313619d2..ea71d6cfef 100644 --- a/synapse/config/__init__.py +++ b/synapse/config/__init__.py @@ -13,9 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ._base import ConfigError, find_config_files, read_config_files +from ._base import ConfigError, find_config_files # export ConfigError, find_config_files, read_config_files if somebody does # import * # this is largely a fudge to stop PEP8 moaning about the import -__all__ = ["ConfigError", "find_config_files", "read_config_files"] +__all__ = ["ConfigError", "find_config_files"] diff --git a/synctl b/synctl index 7ed0218994..a9629cf0e8 100755 --- a/synctl +++ b/synctl @@ -30,7 +30,7 @@ from six import iteritems import yaml -from synapse.config import find_config_files, read_config_files +from synapse.config import find_config_files SYNAPSE = [sys.executable, "-B", "-m", "synapse.app.homeserver"] @@ -179,7 +179,12 @@ def main(): ) sys.exit(1) - config = read_config_files(find_config_files([configfile])) + config_files = find_config_files([configfile]) + config = {} + for config_file in config_files: + with open(config_file) as file_stream: + yaml_config = yaml.safe_load(file_stream) + config.update(yaml_config) pidfile = config["pid_file"] cache_factor = config.get("synctl_cache_factor") |