summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Kotov <kotovalexarian@gmail.com>2020-07-03 17:19:03 +0500
committerGitHub <noreply@github.com>2020-07-03 13:19:03 +0100
commit8097659f6e5740ed2dcaedca2a10bdda29dd6ace (patch)
tree12499368f852e33dbda81b112b7a0b467979eafd
parentMerge tag 'v1.16.0rc2' into develop (diff)
downloadsynapse-8097659f6e5740ed2dcaedca2a10bdda29dd6ace.tar.xz
Allow YAML config file to contain None (#7779)
Useful when config file is fully commented

Signed-off-by: Alex Kotov <kotovalexarian@gmail.com>
-rw-r--r--changelog.d/7779.bugfix1
-rwxr-xr-xsynctl3
2 files changed, 3 insertions, 1 deletions
diff --git a/changelog.d/7779.bugfix b/changelog.d/7779.bugfix
new file mode 100644
index 0000000000..61de45d570
--- /dev/null
+++ b/changelog.d/7779.bugfix
@@ -0,0 +1 @@
+Fix synctl to handle empty config files correctly. Contributed by @kotovalexarian.
diff --git a/synctl b/synctl
index ca398b84bd..9395ebd048 100755
--- a/synctl
+++ b/synctl
@@ -239,7 +239,8 @@ def main():
     for config_file in config_files:
         with open(config_file) as file_stream:
             yaml_config = yaml.safe_load(file_stream)
-        config.update(yaml_config)
+        if yaml_config is not None:
+            config.update(yaml_config)
 
     pidfile = config["pid_file"]
     cache_factor = config.get("synctl_cache_factor")