Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Allow YAML config file to contain None (#7779)
Browse files Browse the repository at this point in the history
Useful when config file is fully commented

Signed-off-by: Alex Kotov <kotovalexarian@gmail.com>
  • Loading branch information
kotovalexarian authored Jul 3, 2020
1 parent f3e0f16 commit 8097659
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/7779.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix synctl to handle empty config files correctly. Contributed by @kotovalexarian.
3 changes: 2 additions & 1 deletion synctl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 8097659

Please sign in to comment.