Skip to content
This repository has been archived by the owner on Jul 1, 2020. It is now read-only.

Commit

Permalink
Adding fallback in case config file is missing "configuration" key
Browse files Browse the repository at this point in the history
  • Loading branch information
zakx committed May 13, 2016
1 parent c413591 commit a45635c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion notify_slack/hooks/notify_slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def _get_config(repo_path):
_create_config(config_path)
config = SafeConfigParser()
config.read(config_path)
if config.get("configuration", "enabled") == "unconfigured":
if config.get("configuration", "enabled", fallback="unconfigured") == "unconfigured":
io.stderr("Slack notifications not configured. Please edit .slack.cfg "
"(it has already been created) and set enabled to 'yes' "
"(or 'no' to silence this message and disable Slack notifications).")
Expand Down

0 comments on commit a45635c

Please sign in to comment.