Fix for SlackObserver from_config method.
@@ -50,8 +50,12 @@ class SlackObserver(RunObserver):
``failed_text``.
"""
d = load_config_file(filename)
- obs = cls(**d)
- for k in ['completed_text', 'interrupted_text', 'failed_text']:
+ obs = None
+ if 'webhook_url' in d:
+ obs = cls(d['webhook_url'])
+ else:
+ raise ValueError("Slack configuration file must contain an entry for 'webhook_url'!")
+ for k in ['completed_text', 'interrupted_text', 'failed_text', 'bot_name', 'icon']:
if k in d:
setattr(obs, k, d[k])
return obs
