Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update config.py #62

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion holmes/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ def load_from_file(cls, config_file: Optional[str], **kwargs) -> "Config":
logging.debug("No config file found, using cli settings only")
config_from_file = None

# prevent unset cli options from overriding defaults (when there is no config file)
cli_options = {
k: v for k, v in kwargs.items() if v is not None and v != []
}
Expand All @@ -280,7 +281,7 @@ def load_from_file(cls, config_file: Optional[str], **kwargs) -> "Config":
return config_from_cli

merged_config = config_from_file.dict()
# remove Nones to avoid overriding config file with empty cli args
# prevent unset cli options from overriding the config file settings
cli_overrides = {
k: v for k, v in config_from_cli.dict().items() if v is not None and v != []
}
Expand Down
Loading