Allow YAML config file to contain None (#7779)

Useful when config file is fully commented

Signed-off-by: Alex Kotov <kotovalexarian@gmail.com>
code_spécifique_watcha
Alex Kotov 4 years ago committed by GitHub
parent f3e0f16240
commit 8097659f6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      changelog.d/7779.bugfix
  2. 3
      synctl

@ -0,0 +1 @@
Fix synctl to handle empty config files correctly. Contributed by @kotovalexarian.

@ -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")

Loading…
Cancel
Save