Skip to content

Commit

Permalink
config: give a meaningful error message for empty targets
Browse files Browse the repository at this point in the history
  • Loading branch information
mathstuf committed Feb 7, 2015
1 parent ed9af7f commit 7d910ff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bugwarrior/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ def validate_config(config, main_section):
die("No targets= item in [%s] found." % main_section)

targets = config.get(main_section, 'targets')
targets = [t.strip() for t in targets.split(",")]
targets = filter(lambda t: len(t), [t.strip() for t in targets.split(",")])

if not targets:
die("Empty targets= item in [%s]." % main_section)

for target in targets:
if target not in config.sections():
Expand Down

0 comments on commit 7d910ff

Please sign in to comment.